Traffic lights controller Project
In this project, using the Arduino board and various electronic components, we can create a traffic light signal where we can control the blinking effect of the LEDs using the following program:
// connecting led on pin 8
void setup()
{
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT); // making pin 8 as OUTPUT pin
}
void loop()
{
digitalWrite(8,HIGH);
digitalWrite(9,LOW);
digitalWrite(10,LOW);
delay(2000);
digitalWrite(8,LOW);
digitalWrite(9,HIGH);
digitalWrite(10,LOW);
delay(2000);
digitalWrite(8,LOW);
digitalWrite(9,LOW);
digitalWrite(10,HIGH);
delay(2000);
}