Advertisement
RuiViana

Untitled

Jan 23rd, 2016
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #define liga 8
  2. #define ativa 0
  3.  
  4. void setup()
  5. {
  6. pinMode(ativa, INPUT);
  7. pinMode(liga, OUTPUT);
  8. }
  9.  
  10. void loop()
  11. {
  12. if((digitalRead(ativa)) == LOW)
  13. {
  14. digitalWrite(liga, HIGH);
  15. delay(500);
  16. }
  17. else
  18. {
  19. digitalWrite(liga, LOW);
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement