Presentation is loading. Please wait.

Presentation is loading. Please wait.

Traffic light programming challenges

Similar presentations


Presentation on theme: "Traffic light programming challenges"— Presentation transcript:

1 Traffic light programming challenges
11/19/2018 Raspberry Pi with Pibrella Neil Rickus, Senior Lecturer in Computing Education, University of Hertfordshire @computingchamps Traffic light programming challenges Written by Neil Rickus. Licensed under CC BY-NC-SA 4.0 1 1

2 Objectives Sequence instructions Use selection (if, then, else)
11/19/2018 Objectives Sequence instructions Use selection (if, then, else) Use repetition Make lights flash and buzzers sound Push the big red button! 2 2

3 11/19/2018 Your challenge! Swarco, the world leader in LED traffic lights, need some new engineers A selection of their products can be seen on the following slide… 3 3

4

5 11/19/2018 Your challenge! Swarco are looking for some new traffic light engineers and want to know if you’re up to the task Can you complete their programming challenges? 5 5

6 Your computer for today…
11/19/2018 Your computer for today… What do you notice about the computer in front of you? 6 6

7 11/19/2018 Getting started We're going to be using Scratch to program the Pibrella, which is connected to the Raspberry Pi Firstly, we need to start the GPIO (General Purpose Input Output) Server We'll then turn on the red light These commands are case sensitive, so check you use of lower and upper case (capital) letters carefully 7 7

8 11/19/2018 8 8

9 Challenges - Lights Program a key to turn the red light off
11/19/2018 Challenges - Lights Program a key to turn the red light off Program a key make the red light flash Program a key to make the yellow light flash Program a key to make the green light flash Program a key to turn all lights off! Program a key to make the traffic light sequence 9 9

10 11/19/2018 10 10

11 11/19/2018 Big red button We're now going to program the Big Red Button to make things happen... We'll start by making it turn a light on Please hold the board by the side as you press the button! 11 11

12 11/19/2018 12 12

13 11/19/2018 Challenges Make the green light always on unless the big red button is pushed Make the big red button work light a pedestrian crossing... 13 13

14 Buzzer Can you make it beep? You'll need to broadcast this command:
11/19/2018 Buzzer Can you make it beep? You'll need to broadcast this command: buzzer1000 buzzer0 (to make it stop!) 14 14


Download ppt "Traffic light programming challenges"

Similar presentations


Ads by Google