Traffic Light System On Arduino
A arduino project of simple Traffic Light System Without Button
Green is connected to pin 0
Yellow is connected to pin 2
Red is connected to pin 4
here is the Arduino code you will need:
int LedRed = 4;
int LedYellow = 2;
int LedGreen = 0;
void setup(){
pinMode(LedRed, OUTPUT);
pinMode(LedYellow, OUTPUT);
pinMode(LedGreen, OUTPUT);
}
void loop(){
digitalWrite(LedRed, LOW);
digitalWrite(LedYellow, LOW);
digitalWrite(LedGreen, HIGH);
delay(3000);
digitalWrite(LedYellow, HIGH);
digitalWrite(LedGreen, LOW);
delay(2000);
digitalWrite(LedYellow, LOW);
digitalWrite(LedRed, HIGH);
delay(3000);
digitalWrite(LedYellow, HIGH);
delay(2000);
}