Arduino Traffic Light Project
Arduino Traffic Light Project
Traffic Light Programming with Arduino IDE (for Basic School Students)
Introduction
Hey there, young techies! Imagine standing at a busy road, waiting to cross. You see the red light
come on - cars stop. Then the yellow light warns that cars should get ready to move. Finally, the
Wouldn't it be cool to make your own traffic light? Today, we'll learn how to make one using Arduino.
4. 3 Resistors (220 ohms each) - To protect the LEDs from burning out.
void setup() {
pinMode(redLight, OUTPUT);
pinMode(yellowLight, OUTPUT);
pinMode(greenLight, OUTPUT);
}
void loop() {
digitalWrite(redLight, HIGH);
digitalWrite(yellowLight, LOW);
digitalWrite(greenLight, LOW);
delay(5000);
digitalWrite(redLight, LOW);
digitalWrite(yellowLight, HIGH);
digitalWrite(greenLight, LOW);
delay(2000);
digitalWrite(redLight, LOW);
digitalWrite(yellowLight, LOW);
digitalWrite(greenLight, HIGH);
delay(5000);
}
11. High and Low States (HIGH, LOW) - Represent ON and OFF signals.
Why These Terms Matter:
Understanding these terms is like knowing the rules of a game. Once you know them, you can build