Skip to content

Instantly share code, notes, and snippets.

@mskf1383
Created August 3, 2024 08:08
Show Gist options
  • Select an option

  • Save mskf1383/c4e723fcc48ae26f5a551e4791e7a673 to your computer and use it in GitHub Desktop.

Select an option

Save mskf1383/c4e723fcc48ae26f5a551e4791e7a673 to your computer and use it in GitHub Desktop.
void warn() {
// print in serial
Serial.print(" --Angle ");
Serial.print(angle);
Serial.print("-- Unwanted object in ");
Serial.print(newDistance);
Serial.println("cm!");
// play sound
tone(piezoPin, 1000);
// show in monitor
monitor.showNumberDec(newDistance, false);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment