Advertisement
RuiViana

CEI_Teste_ESP8266

Apr 11th, 2018
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #define LED 2
  2. #define SW 12
  3. //--------------------------------------
  4. void setup()
  5. {
  6.   pinMode(SW, INPUT_PULLUP);
  7.   pinMode(LED, OUTPUT);
  8.   digitalWrite(LED, HIGH);
  9. }
  10. //--------------------------------------
  11. void loop()
  12. {
  13.   if (digitalRead(SW) == 0)
  14.   {
  15.     delay(30);
  16.     if (digitalRead(SW) == 0)
  17.     {
  18.       digitalWrite(LED, LOW);
  19.       delay(1000);
  20.       digitalWrite(LED, HIGH);
  21.       delay(1000);
  22.     }
  23.   }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement