
NewPing Works with many ultrasonic sensors, can communicate using only one pin, very low lag, fast (up to 30 pings per second), timer interrupt method for event-driven sketches, light code, and much more. Melody (liberated from the toneMelody Arduino example sketch by Tom Igoe). #include #define TONE_PIN 2 // Pin you have speaker/piezo connected to (be sure to include a 100 ohm resistor). NoNewTone(pin) - Stop playing note (pin is optional, will always stop playing on pin that was last used).

zip Library instructions to import the library into the Arduino IDE. zip file to your desktop, then use the Importing a.


Uses timer 1 which may free up conflicts with the tone library. Higher quality sound output than tone library. Exclusive use of port registers for fastest and smallest code. About 1,200 bytes smaller code size than the standard tone library.
