explicitly setting digital pins as output in some cases; adding an opto pin on 3