Created
October 12, 2018 14:54
-
-
Save recursivecodes/63dac281f94dd8a4095dc7e51c2ebf86 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void loop() { | |
int read = analogRead(SENSOR); | |
Serial.println(read); | |
if( read > 50 ) { | |
Serial.println("on"); | |
digitalWrite(LED,HIGH); | |
tone(BUZZER, 10); | |
delay(100); | |
}else { | |
digitalWrite(LED,LOW); | |
noTone(BUZZER); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment