In this project I created a traffic light prototype with an Arduino UNO. The LEDs would have to light up at the sequence of a real traffic light and work in a constant loop. Materials used in the project:
- Arduino UNO
- breadboard
- 5mm LED
- 220 ohm resistors
- wires

I used the Arduino programming software to create the code for the traffic light.
#define RED_PIN 5 // defining the constants
#define YELLOW_PIN 4
#define GREEN_PIN 3
void setup() { // binding them to outputs
pinMode(RED_PIN, OUTPUT);
pinMode(YELLOW_PIN, OUTPUT);
pinMode(GREEN_PIN, OUTPUT);
}
void loop() { //main loop
digitalWrite(RED_PIN, HIGH);
delay(2000);
digitalWrite(YELLOW_PIN, HIGH);
delay(1000);
digitalWrite(YELLOW_PIN, LOW);
digitalWrite(RED_PIN, LOW);
digitalWrite(GREEN_PIN, HIGH);
delay(2500);
digitalWrite(GREEN_PIN, LOW);
}

