SHARE
TWEET

Untitled

a guest Sep 18th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void setup(){
  2.   pinMode(5, OUTPUT);
  3.   pinMode(6, OUTPUT);
  4.   pinMode(7, OUTPUT);
  5.   pinMode(8, OUTPUT);
  6.   pinMode(9, OUTPUT);
  7.   pinMode(10, OUTPUT);
  8.   pinMode(11, INPUT);
  9.   pinMode(12, INPUT);
  10. }
  11. void loop() {  
  12.   if(digitalRead(11) == LOW);
  13.   digitalWrite(5,HIGH);  //apaga o led vermelho (sinal 1)
  14.   digitalWrite(7,LOW); //acende o led verde (sinal 1)
  15.   digitalWrite(8,LOW); //acende o led vermelho (sinal 2)
  16.   delay(4000);          //espera 4 segundos
  17.   digitalWrite(7,HIGH);  //apaga o led verde (sinal 1)        
  18.    
  19.   digitalWrite(6,LOW);//acende o led amarelo (sinal 1)
  20.   delay(2000);          //espera 2 segundos
  21.   digitalWrite(6,HIGH);  //apaga o led amarelo (sinal 1)
  22.    
  23.   digitalWrite(5,LOW); //acende o led vermelho (sinal 1)
  24.   digitalWrite(8,HIGH);  //apaga o led vermelho (sinal 2)
  25.   digitalWrite(10,LOW); //acende o led verde (sinal 2)
  26.   delay(4000);          //espera 4 segundos
  27.   digitalWrite(10,HIGH); //apaga o led verde (sinal 2)
  28.    
  29.   digitalWrite(9,LOW); //acende o led amarelo (sinal 2)
  30.   delay(2000);          //espera 2 segundos
  31.   digitalWrite(9,HIGH);  //apaga o led amarelo (sinal 2)  
  32. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top