Advertisement
TomasDm

Semáforo con luces led (Arduino) (C++)

May 23rd, 2019
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. int rojo = 8;
  2. int verde = 10;
  3. int amarillo = 9;
  4.  
  5. void setup () {
  6.   pinMode (8, OUTPUT);
  7.   pinMode (9, OUTPUT);
  8.   pinMode (10, OUTPUT);
  9.  
  10.   }
  11.  
  12. void loop (){
  13.   digitalWrite (rojo, HIGH);
  14.   delay(5000);
  15.   digitalWrite (rojo, LOW);
  16.   digitalWrite (amarillo, HIGH);
  17.   delay(700);
  18.   digitalWrite (amarillo, LOW);
  19.   digitalWrite (verde, HIGH);
  20.   delay(5000);
  21.   digitalWrite (verde, LOW);
  22.   digitalWrite (amarillo, HIGH);
  23.   delay(700);
  24.   digitalWrite (amarillo, LOW);
  25.  
  26.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement