jehankandt
Published © Apache-2.0

Arduino Traffic Light System

Arduino Traffic Light System

AdvancedFull instructions provided1,571
Arduino Traffic Light System

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
5 mm LED: Red
5 mm LED: Red
×1
5 mm LED: Yellow
5 mm LED: Yellow
×1
5 mm LED: Green
5 mm LED: Green
×1
Resistor 220 ohm
Resistor 220 ohm
×3
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE
Arduino Web Editor
Arduino Web Editor

Story

Read more

Schematics

Arduino with Traffic Light system

Arduino with Traffic Light system

Code

Arduino with Traffic Light system

C/C++
Arduino with Traffic Light system
//...............JehanKandy........................
//...........www.jehankandy.com....................
//........www.github.com/JehanKandy................

//......Arduino Based Traffic Light System 1.0.....


//create Variables.....
int R_LED = 3; //Red LED
int Y_LED = 4; //Yello LED
int G_LED = 5; //Green LED 

void setup() {
  pinMode(3,OUTPUT);
  pinMode(4,OUTPUT);
  pinMode(5,OUTPUT);

}

void loop() {
  //part 1
  digitalWrite(R_LED,HIGH);
  digitalWrite(Y_LED,LOW);
  digitalWrite(G_LED,LOW);
  delay(30000); //wait 30 seocnds

  //part 2
  digitalWrite(R_LED,HIGH);
  digitalWrite(Y_LED,HIGH);
  digitalWrite(G_LED,LOW);
  delay(2000); //wait 2 seocnds

  //part 3
  digitalWrite(R_LED,LOW);
  digitalWrite(Y_LED,LOW);
  digitalWrite(G_LED,HIGH);
  delay(30000); //wait 30 seocnds

  //part 5;
  digitalWrite(R_LED,LOW);
  digitalWrite(Y_LED,HIGH);
  digitalWrite(G_LED,LOW);
  delay(2000); //wait 2 seocnds

}

//.........coded by : JehanKandy....
//...........Thank You..............

Credits

jehankandt
21 projects • 8 followers
Contact

Comments

Please log in or sign up to comment.