Your shopping cart is empty!
Project 2 : Interactive Traffic Light
- Hussien Jawhar Sathik
- 07 Feb 2023
- Tutorial
- 327
Introduction
Interactive Traffic Light is a traffic light combination of standard traffic light for vehicles and traffic light for pedestrians.
Component Used
Breadboard 8.5x5.5cm (400 Holes)
40-Way 10cm Dupont Jumper Wire
LED 5mm Green x2
LED 5mm Yellow x1
LED 5mm Red x2
Resistor 0.25W 5% (220R) x5
Objective
In this project we will apply the 2 lessons which we have learned previously in:
1. Lesson 1: LED Blink
2. Lesson 4: Digital Input
Code
Result
At start/normal condition, green LED (vehicle) and red LED (pedestrian) will light up. When push button is pressed, green LED (vehicle) will turn off and yellow LED (vehicle) will turn on for 2 seconds. After that, yellow LED (vehicle) will turn off and red LED (vehicle) will light up. After 1 second, when it is time for pedestrians to cross the road, green LED (pedestrian) will turn on for 5 seconds. Then, green LED (pedestrian) will turn off and red LED (pedestrian) will turn on. After 1 second, it will back to normal condition.