Last active
January 20, 2019 23:28
-
-
Save blister/a36b85c92acaea835fc1479fbf0f5c07 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() { | |
delay(50); | |
// See if an object is in front of us | |
int distance = msToCm(ping()); | |
//Serial.println(distance); | |
if ( distance < detectionDistance ) { | |
// get a random song | |
playNote(NOTE_G5, 100, .1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment