Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Programming and Electronics with the Raspberry Pi

Matt J Williams
July 19, 2012
29

Programming and Electronics with the Raspberry Pi

Outreach demo for a School of Computer Science & Informatics Open Day event. With Mark Greenwood. July 2012.

Matt J Williams

July 19, 2012
Tweet

Transcript

  1. =

  2. turnOn(1) turns on the first light turnOn(2) turns on the

    second light turnOff(1) turns off the first light sleep(2.5) wait for 2.5 seconds What instructions can we use?
  3. Let's use a new instruction: isPressed() while True: if isPressed():

    turnOff(1) turnOn(2) else: turnOff(2) turnOn(1) sleep(0.1) How can we use the button?