Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int outRelay = 8;
- int sound = 7;
- boolean state = false;
- void setup() {
- pinMode(outRelay, OUTPUT);
- pinMode(sound, INPUT);
- }
- void loop() {
- if (digitalRead(sound) == LOW) {
- delay(100);
- state = !state;
- digitalWrite(outRelay, state);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement