Cheers guys. Am I right that it's pinC.1 and pinC.4 for the switch? I've (hopefully) attached a circuit diagram of what I'm trying to do. Also, since making the changes you suggested, the servo now seems to move randomly and not when I flick the switch. I can't see any obvious errors in the program.