Arduino Traffic Signals Project

Arduino Traffic Signals Project

This Project will demonstrate how Traffic Signals works.

Hardware Required:

1x Arduino Uno

1x Red Light 5MM

1x Yellow Light 5MM

1x Green Light 5MM

3x 220 ohm Resistors

1x Bread board & some Jumpire Cables M-M

Want to Buy Complete Kit Click Here

 

Arduino Pin Layout:

Code:

/*
* OR97 Arduino Maker Basic Kit
* Project#3 Arduino Traffic Signals Project
* Made By: OR97 Team
* Kit Link=https://www.or97.com/arduino-maker-basic-kit
*/

int RedLED=6;
int YellowLED=5;
int GreenLED=4;
void setup() {
// put your setup code here, to run once:
pinMode(GreenLED,OUTPUT);
pinMode(YellowLED,OUTPUT);
pinMode(RedLED,OUTPUT);

//make all LEDs Off
digitalWrite(GreenLED,LOW);
digitalWrite(YellowLED,LOW);
digitalWrite(RedLED,LOW);

}

void loop() {

//Stop Traffic Red Signal
digitalWrite(GreenLED,LOW);
digitalWrite(RedLED,HIGH);
delay(10000);

//Get Read Yellow Signal
digitalWrite(RedLED,LOW);
digitalWrite(YellowLED,HIGH);
delay(10000);

//Go Green Signal
digitalWrite(YellowLED,LOW);
digitalWrite(GreenLED,HIGH);
delay(10000);
}