๐ ๏ธ Section project: fix the traffic light
Section 2: Wiring and the traffic lightLesson 2.3 ยท โฑ 10 min
๐ฏ Project goal
The traffic light program has 3 hidden mistakes. Find them and fix them, as engineers do.
- Run the program and watch: which LED behaves wrongly?
- Read the blocks line by line: is the pin number right? Are HIGH and LOW in their places? Is there a delay after every colour?
๐ Another example: the correct traffic light
After fixing the mistakes: each LED lights alone, in the right order.


โ๏ธ Practise
Fix the three mistakes.
โ๏ธ Practise here in the lessonโ Close the labor open the lab in a new page โ
โ๏ธ Practise
Extra challenge: make the yellow blink 3 times before the red.
โ๏ธ Practise here in the lessonโ Close the labor open the lab in a new page โ
๐ฏ Challenge yourself
Easy
The mistake: green is on pin 10 instead of 11. Fix it.
๐ Show the solution๐ Hide the solution


Result: the green lights on 11.
Medium
The mistake: the red never goes off (we forgot LOW). Fix it.
๐ Show the solution๐ Hide the solution


Result: the red goes off before the green.
Hard
The mistake: there is no wait after the yellow, so we don't see it. Fix it.
๐ Show the solution๐ Hide the solution


Result: the yellow shows for 0.8 seconds.

