Guest User

Untitled

a guest
Jan 21st, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. void loop() {
  2. delay(50);
  3. // See if an object is in front of us
  4. int distance = msToCm(ping());
  5.  
  6. //Serial.println(distance);
  7. if ( distance < detectionDistance ) {
  8. // get a random song
  9. playNote(NOTE_G5, 100, .1);
  10. }
  11. }
Add Comment
Please, Sign In to add comment