Advertisement
RuiViana

LigaRele

Nov 27th, 2019
497
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. #define botao 2
  2. #define rele 5
  3. void setup()
  4. {
  5.   pinMode(botao, INPUT_PULLUP);
  6.   pinMode(rele, OUTPUT);
  7. }
  8.  
  9. void loop()
  10. {
  11.   if (digitalRead(botao == LOW))
  12.   {
  13.     delay(30);
  14.   }
  15.   if (digitalRead(botao == LOW))
  16.   {
  17.     digitalWrite(rele, !digitalRead(botao));
  18.   }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement