Anjali Shaw
Published

Traffic Light System

Here we will lit the leds in the same manner it is lit up in traffic system

BeginnerFull instructions provided499
Traffic Light System

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
you will need only arduino uno board
×1
Breadboard (generic)
Breadboard (generic)
×1
5 mm LED: Red
5 mm LED: Red
×1
5 mm LED: Green
5 mm LED: Green
×1
5 mm LED: Yellow
5 mm LED: Yellow
I have used this color as I don't have amber
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Resistor 330 ohm
Resistor 330 ohm
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

circuit diagram

Code

Here we go with the code

Arduino
paste the code or you can write in IDE
int ledPinr=10;
int ledPiny=9;
int ledPing=8;


void setup() {

  pinMode(ledPinr,OUTPUT);
  pinMode(ledPiny,OUTPUT);
  pinMode(ledPing,OUTPUT);
  
  // put your setup code here, to run once:

}

void loop() {

  digitalWrite(ledPing,HIGH);
  delay(5000);
  digitalWrite(ledPing,LOW);

  digitalWrite(ledPiny,HIGH);
  delay(3000);
  digitalWrite(ledPiny,LOW);


  
  digitalWrite(ledPinr,HIGH);
  delay(5000);
  digitalWrite(ledPinr,LOW);

  // put your main code here, to run repeatedly:

}

Credits

Anjali Shaw

Anjali Shaw

1 project • 0 followers

Comments