$30 off During Our Annual Pro Sale. View Details »

Programming and Electronics with the Raspberry Pi

Matt J Williams
July 19, 2012
17

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. Programming and Electronics with the Raspberry Pi School of Computer

    Science & Informatics
  2. What is the Raspberry Pi?

  3. What is the Raspberry Pi?

  4. What is the Raspberry Pi?

  5. =

  6. How much does a Raspberry Pi cost?

  7. What are we doing today?

  8. Let's run our first program!

  9. Let's run our first program!

  10. Let's run our first program!

  11. 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?
  12. Try making your own light patterns!

  13. What about repeating a pattern?

  14. for i in range(5): turnOff(2) sleep(1.0) turnOn(2) sleep(1.0) What about

    a repeating pattern?
  15. Try making your own repeating patterns!

  16. How can we use the button?

  17. 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?
  18. Try making a pattern that starts when you press the

    button