Updated pin.cpp to use combinaion of enums and Pin Class

Also added sample usage case in comment block below. Imo, best of both worlds.