RuiViana

LigaRele

Nov 27th, 2019
229
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data