Advertisement
Guest User

Untitled

a guest
Jun 9th, 2015
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. int BT2 = 2; //botão 2 manual
  2.  
  3. //Estado dos botões
  4. int EstadoBT2 = 0;
  5.  
  6. void setup() {
  7. //Comunicação Serial
  8. Serial.begin(9600);
  9.  
  10. // inicializa as entradas:
  11. pinMode(BT2, INPUT);
  12.  
  13. // inicializa as saidas:
  14.  
  15. }
  16.  
  17. void loop(){
  18. // le valor botao:
  19. EstadoBT2 = digitalRead (BT2);
  20.  
  21.  
  22. // verifica se botao pressionado
  23. // verifica se botao esta estado alto:
  24. if (EstadoBT2 == HIGH) { //
  25.  
  26. Serial.println(" FOGO! SETOR 1 E 2 FUDEU! CORRE MULAMBADA! ");
  27. delay (1000); // Atraso para ver melhor no monitor serial pode ser modificado
  28. }
  29. else {
  30.  
  31. Serial.println(" SEM FOGO TRABALHA NA PAZ MULAMBADA! ");
  32. delay (1000); // Atraso para ver melhor no monitor serial pode ser modificado );
  33.  
  34.  
  35. }
  36.  
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement