noTone()
Description
Stops the generation of a square wave triggered by tone(). Has no effect if no tone is being generated.
Syntax
noTone(pin)
Parameter Values
- pin: the Arduino pin on which to stop generating the tone
Return Values
- Nothing
Example
Let's to play "Jingle Bells" song with Arduino.
Hardware Required
Wiring Diagram
This image is created using Fritzing. Click to enlarge image
Arduino Code
For more detailed instruction, see Arduino - Piezo Buzzer
※ NOTES AND WARNINGS:
If you want to play different pitches on multiple pins, you need to call noTone() on one pin before calling tone() on the next pin.
See Also
- Language : pulseIn()
- Language : pulseInLong()
- Language : shiftIn()
- Language : shiftOut()
- Language : tone()
- Example : Arduino - Piezo Buzzer
※ ARDUINO BUY RECOMMENDATION
Arduino UNO R3 | |
Arduino Starter Kit |