Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define liga 8
- #define ativa 0
- void setup()
- {
- pinMode(ativa, INPUT);
- pinMode(liga, OUTPUT);
- }
- void loop()
- {
- if((digitalRead(ativa)) == LOW)
- {
- tone(liga,1500);
- delay(500);
- }
- else
- {
- noTone(liga);
- delay(500);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement