msr048
Published © LGPL

Traffic Lights Using Arduino Uno

Traffic lights using Arduino Uno and 7-segment display.

AdvancedFull instructions provided748
Traffic Lights Using Arduino Uno

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
Resistor 330 ohm
Resistor 330 ohm
×4
Male/Female Jumper Wires
Male/Female Jumper Wires
×1
Solderless Breadboard Full Size
Solderless Breadboard Full Size
×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
7 segment display (CA/CC)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

scissor
Tape

Story

Read more

Schematics

Circuit Diagram

Tr wowsztsayd

Code

Arduino code

Arduino
//www.youtube.com/Electronics is Fun//
//www.facebook.com/Electronics os Fun//
//copyright by MOHD SOHAIL//

int a=2;
int b=3;
int c=4;
int d=5;
int e=6;
int f=7;
int g=8;
int green=11;
int yellow=12;
int red=13;
void setup() {
 pinMode(a, OUTPUT);
 pinMode(b, OUTPUT);
 pinMode(c, OUTPUT);
 pinMode(d, OUTPUT);
 pinMode(e, OUTPUT);
 pinMode(f, OUTPUT);
 pinMode(g, OUTPUT);
 pinMode(green, OUTPUT);
 pinMode(yellow, OUTPUT);
 pinMode(red, OUTPUT);
 

}

void loop() {
 //9 
 digitalWrite(a,1);
 digitalWrite(b,1);
 digitalWrite(c,1);
 digitalWrite(d,1);
 digitalWrite(e,0);
 digitalWrite(f,1);
 digitalWrite(g,1);
 digitalWrite(green,0);
 digitalWrite(yellow,0);
 digitalWrite(red,1);
 delay(1000);

 //8
 digitalWrite(a,1);
 digitalWrite(b,1);
 digitalWrite(c,1);
 digitalWrite(d,1);
 digitalWrite(e,1);
 digitalWrite(f,1);
 digitalWrite(g,1);
 digitalWrite(green,0);
 digitalWrite(yellow,0);
 digitalWrite(red,1);
 delay(1000);

 //7
 digitalWrite(a,1);
 digitalWrite(b,1);
 digitalWrite(c,1);
 digitalWrite(d,0);
 digitalWrite(e,0);
 digitalWrite(f,0);
 digitalWrite(g,0);
 digitalWrite(green,0);
 digitalWrite(yellow,0);
 digitalWrite(red,1);
 delay(1000);

 //6
  digitalWrite(a,1);
 digitalWrite(b,0);
 digitalWrite(c,1);
 digitalWrite(d,1);
 digitalWrite(e,1);
 digitalWrite(f,1);
 digitalWrite(g,1);
 digitalWrite(green,0);
 digitalWrite(yellow,0);
 digitalWrite(red,1);
 delay(1000);

 //5
  digitalWrite(a,1);
 digitalWrite(b,0);
 digitalWrite(c,1);
 digitalWrite(d,1);
 digitalWrite(e,0);
 digitalWrite(f,1);
 digitalWrite(g,1);
 digitalWrite(green,0);
 digitalWrite(yellow,0);
 digitalWrite(red,1);
 delay(1000);

 //4
  digitalWrite(a,0);
 digitalWrite(b,1);
 digitalWrite(c,1);
 digitalWrite(d,0);
 digitalWrite(e,0);
 digitalWrite(f,1);
 digitalWrite(g,1);
 digitalWrite(green,0);
 digitalWrite(yellow,0);
 digitalWrite(red,1);
 delay(1000);

 //3
  digitalWrite(a,1);
 digitalWrite(b,1);
 digitalWrite(c,1);
 digitalWrite(d,1);
 digitalWrite(e,0);
 digitalWrite(f,0);
 digitalWrite(g,1);
 digitalWrite(green,0);
 digitalWrite(yellow,0);
 digitalWrite(red,1);
 delay(1000);

 //2
  digitalWrite(a,1);
 digitalWrite(b,1);
 digitalWrite(c,0);
 digitalWrite(d,1);
 digitalWrite(e,1);
 digitalWrite(f,0);
 digitalWrite(g,1);
 digitalWrite(green,0);
 digitalWrite(yellow,0);
 digitalWrite(red,1);
 delay(1000);

 //1
  digitalWrite(a,0);
 digitalWrite(b,1);
 digitalWrite(c,1);
 digitalWrite(d,0);
 digitalWrite(e,0);
 digitalWrite(f,0);
 digitalWrite(g,0);
 digitalWrite(green,0);
 digitalWrite(yellow,0);
 digitalWrite(red,1);
 delay(1000);
 
 //0
  digitalWrite(a,1);
 digitalWrite(b,1);
 digitalWrite(c,1);
 digitalWrite(d,1);
 digitalWrite(e,1);
 digitalWrite(f,1);
 digitalWrite(g,0);
 digitalWrite(green,0);
 digitalWrite(yellow,0);
 digitalWrite(red,1);
 delay(1000);

  //4
  digitalWrite(a,0);
 digitalWrite(b,1);
 digitalWrite(c,1);
 digitalWrite(d,0);
 digitalWrite(e,0);
 digitalWrite(f,1);
 digitalWrite(g,1);
 digitalWrite(green,0);
 digitalWrite(yellow,1);
 digitalWrite(red,0);
 delay(1000);

 //3
  digitalWrite(a,1);
 digitalWrite(b,1);
 digitalWrite(c,1);
 digitalWrite(d,1);
 digitalWrite(e,0);
 digitalWrite(f,0);
 digitalWrite(g,1);
 digitalWrite(green,0);
 digitalWrite(yellow,1);
 digitalWrite(red,0);
 delay(1000);

 //2
  digitalWrite(a,1);
 digitalWrite(b,1);
 digitalWrite(c,0);
 digitalWrite(d,1);
 digitalWrite(e,1);
 digitalWrite(f,0);
 digitalWrite(g,1);
 digitalWrite(green,0);
 digitalWrite(yellow,1);
 digitalWrite(red,0);
 delay(1000);

 //1
  digitalWrite(a,0);
 digitalWrite(b,1);
 digitalWrite(c,1);
 digitalWrite(d,0);
 digitalWrite(e,0);
 digitalWrite(f,0);
 digitalWrite(g,0);
 digitalWrite(green,0);
 digitalWrite(yellow,1);
 digitalWrite(red,0);
 delay(1000);
 
 //0
  digitalWrite(a,1);
 digitalWrite(b,1);
 digitalWrite(c,1);
 digitalWrite(d,1);
 digitalWrite(e,1);
 digitalWrite(f,1);
 digitalWrite(g,0);
 digitalWrite(green,0);
 digitalWrite(yellow,1);
 digitalWrite(red,0);
 delay(1000);

 //9 
 digitalWrite(a,1);
 digitalWrite(b,1);
 digitalWrite(c,1);
 digitalWrite(d,1);
 digitalWrite(e,0);
 digitalWrite(f,1);
 digitalWrite(g,1);
 digitalWrite(green,1);
 digitalWrite(yellow,0);
 digitalWrite(red,0);
 delay(1000);

 //8
 digitalWrite(a,1);
 digitalWrite(b,1);
 digitalWrite(c,1);
 digitalWrite(d,1);
 digitalWrite(e,1);
 digitalWrite(f,1);
 digitalWrite(g,1);
 digitalWrite(green,1);
 digitalWrite(yellow,0);
 digitalWrite(red,0);
 delay(1000);

 //7
 digitalWrite(a,1);
 digitalWrite(b,1);
 digitalWrite(c,1);
 digitalWrite(d,0);
 digitalWrite(e,0);
 digitalWrite(f,0);
 digitalWrite(g,0);
 digitalWrite(green,1);
 digitalWrite(yellow,0);
 digitalWrite(red,0);
 delay(1000);

 //6
  digitalWrite(a,1);
 digitalWrite(b,0);
 digitalWrite(c,1);
 digitalWrite(d,1);
 digitalWrite(e,1);
 digitalWrite(f,1);
 digitalWrite(g,1);
 digitalWrite(green,1);
 digitalWrite(yellow,0);
 digitalWrite(red,0);
 delay(1000);

 //5
  digitalWrite(a,1);
 digitalWrite(b,0);
 digitalWrite(c,1);
 digitalWrite(d,1);
 digitalWrite(e,0);
 digitalWrite(f,1);
 digitalWrite(g,1);
 digitalWrite(green,1);
 digitalWrite(yellow,0);
 digitalWrite(red,0);
 delay(1000);

 //4
  digitalWrite(a,0);
 digitalWrite(b,1);
 digitalWrite(c,1);
 digitalWrite(d,0);
 digitalWrite(e,0);
 digitalWrite(f,1);
 digitalWrite(g,1);
 digitalWrite(green,1);
 digitalWrite(yellow,0);
 digitalWrite(red,0);
 delay(1000);

 //3
  digitalWrite(a,1);
 digitalWrite(b,1);
 digitalWrite(c,1);
 digitalWrite(d,1);
 digitalWrite(e,0);
 digitalWrite(f,0);
 digitalWrite(g,1);
 digitalWrite(green,1);
 digitalWrite(yellow,0);
 digitalWrite(red,0);
 delay(1000);

 //2
  digitalWrite(a,1);
 digitalWrite(b,1);
 digitalWrite(c,0);
 digitalWrite(d,1);
 digitalWrite(e,1);
 digitalWrite(f,0);
 digitalWrite(g,1);
 digitalWrite(green,1);
 digitalWrite(yellow,0);
 digitalWrite(red,0);
 delay(1000);

 //1
  digitalWrite(a,0);
 digitalWrite(b,1);
 digitalWrite(c,1);
 digitalWrite(d,0);
 digitalWrite(e,0);
 digitalWrite(f,0);
 digitalWrite(g,0);
 digitalWrite(green,1);
 digitalWrite(yellow,0);
 digitalWrite(red,0);
 delay(1000);
 
 //0
  digitalWrite(a,1);
 digitalWrite(b,1);
 digitalWrite(c,1);
 digitalWrite(d,1);
 digitalWrite(e,1);
 digitalWrite(f,1);
 digitalWrite(g,0);
 digitalWrite(green,1);
 digitalWrite(yellow,0);
 digitalWrite(red,0);
 delay(1000);

 
}

Credits

msr048

msr048

0 projects • 21 followers

Comments