priyanka_p1PROFESSORHULK
Published © GPL3+

Simple Traffic Light Controller

This is a basic Arduino project that involves blinking LED lights as a traffic controller. The best is that it is automated fully.

BeginnerFull instructions provided1 hour1,230
Simple Traffic Light Controller

Things used in this project

Story

Read more

Schematics

Picture of the project

Code

blinking_led_code_.ino

C/C++
//Modified by ProfessorHulk

int R = 5;
int Y = 6;
int G = 7;

void setup()
{
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);
}

void loop()
{
  //Red light starts glowing:
  digitalWrite(R, HIGH);
  delay(3000);
  digitalWrite(R, LOW);
  delay(1000);
  
  //Yellow light starts to glow:
  digitalWrite(Y, HIGH);
  delay(3000);
  digitalWrite(Y,LOW);
  delay(1000);
  
  //Green Light starts t0 glow:
  digitalWrite(G, HIGH);
  delay(1000);
  digitalWrite(G, LOW);
  delay(500);
  digitalWrite(G, HIGH);
  delay(1000);
  digitalWrite(G, LOW);
  delay(500);
  digitalWrite(G, HIGH); // IT FLICKERS TWICE and then blinks continuously
  delay(3000);
  digitalWrite(G, LOW);
  delay(500);
  
  
}

Credits

priyanka_p1
4 projects • 4 followers
Contact
PROFESSORHULK
10 projects • 9 followers
Contact

Comments

Please log in or sign up to comment.