๐ ๏ธ Section project: the coloured parking sensor
Section 6: Distance, the screen and coloursLesson 6.4 ยท โฑ 15 min
๐ฏ Project goal
Closer than 15 cm: red and the buzzer rings. Closer than 40 cm: yellow with no buzzer. Otherwise: green.
We need three cases, so we put an if inside the else: if closer than 15 โฆ else if closer than 40 โฆ else โฆ

๐ Another example: parking with sound too
Very close (below 15): red and beeping. Medium (below 40): yellow. Far: green.




โ๏ธ Practise
Build the parking sensor.
โ๏ธ Practise here in the lessonโ Close the labor open the lab in a new page โ
๐ฏ Challenge yourself
Easy
Only two colours: green when far (30 or more), and red when close.
๐ Show the solution๐ Hide the solution


Result: green, then red.
Medium
Close: the red LED blinks.
๐ Show the solution๐ Hide the solution


Result: red blinking.
Hard
Very close (below 10): the buzzer beeps without stopping.
๐ Show the solution๐ Hide the solution


Result: non-stop beeping.

