Traffic Light Control | Street Light Control using Tinkercad

Опубликовано: 12 Январь 2023
на канале: Learn with Zoolnurain
478
10

This is the simple traffic light control circuit designed in Tinkercad using Arduino UNO.

The green Led blinks for three second then yelllow LED blinks for one second and then red LED blinks for three second and process repeat again and again.

The Tinkercad link is below:
https://www.tinkercad.com/things/1aqq...

Code:
void setup()
{
pinMode(0, OUTPUT);
pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
}

void loop()
{
digitalWrite(0, HIGH); // For green LED
delay(3000); // Wait for 3 second
digitalWrite(0, LOW);


digitalWrite(1, HIGH); // For yellow LED
delay(1000); // Wait for 1 second
digitalWrite(1, LOW);


digitalWrite(2, HIGH); // For the red LED
delay(3000); // Wait for 3 second
digitalWrite(2, LOW);
}