set the pin modes appropriately