AWOL: Thanks for the feedback. I was under the impression that the scope of variables and objects created in the void setup meant they were accessible throughout the rest of the code, but by the sounds of it that's quite wrong. I've removed the code relating to the variable and object from the void setup and moved them both into PushButton() like so. Will this work as intended now?

PaulS: That makes perfect sense, well done! That's exactly the sort of thing that might have been very difficult for me to figure out on my own. I think I'll try your second recommendation "if ( Serial.read() == '1') {".

##################################################################################################### Communicate with Arduino####################################################################################################print "Sending a 1 to Arduino..."#Send a 1 (integer!) over serial to the Arduino, telling it to turn on the lights and push the buttonser = serial.Serial('/dev/tty.usbserial', 9600)ser.write(1)

print "Waiting to receive a 'finished' from the Arduino..."#Wait until receive the OK from the Arduino, meaning it has finished all it's tasks.while 1 msgarduino = ser.readline() if msgarduino == 1 break