Traffic Light with Arduino

4,134 views · Published 11 February 2018 · 1:37 · Indexed 23 September 2026

Channel: Electronic Projects Stefano91ste · 2018 · Science & Technology

Watch on YouTube

Small LED traffic light managed by Arduino.

Classic electronic traffic light: https://www.youtube.com/watch?v=mi1HVkeIie0

CODE:
int led_g = 8;                    
int led_y = 9;                   
int led_r = 10;          
int pause1 = 5000;                    
int pause2 = 7000;
void setup(){
  pinMode(led_g, OUTPUT);         
  pinMode(led_y, OUTPUT);        
  pinMode(led_r, OUTPUT);        
}
void loop(){
  digitalWrite(led_r, HIGH);      
  delay(pause2);                                  
  digitalWrite(led_r, LOW);        
  digitalWrite(led_g, HIGH);      
  delay(pause1);                               
  digitalWrite(led_y,HIGH);      
  delay(pause2);                               
  digitalWrite(led_g, LOW);      
  digitalWrite(led_y, LOW);                                      
}

► My Channel: https://www.youtube.com/user/Stefano91ste
► My WebSite: http://stefano91ste.altervista.org

► Music by NoCopyrightSounds: https://www.youtube.com/user/NoCopyrightSounds

WARNING: This video is only for demonstration. I don't take any responsibility for damage to things, people and animals.

About Electronics Projects - Stefano91ste
Electronics Projects - Stefano91ste is a channel dedicated to electronics with many electronic projects, in any video (uploaded since 2017), you will find the electrical scheme dedicated to that project. I wanted to create this channel in order to spread my electronic projects. The electronics lab is located in Italy, but thanks to the English language my videos can be watched all over the world!!!

► My equipment:
Panasonic HC-V180 (Main Camera)
Huawei P8 Lite
iPhone 6 #ElectronicProjects #Electronic

More from this channel