Thank you DVDdoug for your very detailed reply. I appreciate the time it took you to write that..
I am using 1p and 2p coins (uk).
How do I swap the push button for the optical switch?
Do I use the same resistors?
So far I have tried to set it up this way: How to Build a Robot Tutorials - Society of Robots (first diagram) using R1 = 80R and R2 = 800R. I have run standard firmata to test the outputs and the A1 pin reads 1021, and is not effected by covering the emitter with a coin.
What have I done wrong?