Advertisement
RuiViana

Untitled

Jan 23rd, 2016
285
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. tone(liga,1500);
  15. delay(500);
  16. }
  17. else
  18. {
  19. noTone(liga);
  20. delay(500);
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement