This shows you the differences between two versions of the page.
arduino:advanced_io:tone [2013/02/15 19:00] 158.181.88.241 [See also] |
arduino:advanced_io:tone [2024/02/16 01:04] (current) |
||
---|---|---|---|
Line 2: | Line 2: | ||
====Description ==== | ====Description ==== | ||
- | Generates a square wave of the specified frequency (and 50% duty cycle) on a pin. A duration can be specified, otherwise the wave continues until a call to [[arduino:advanced io:NoTone]](). The pin can be connected to a piezo buzzer or other speaker to play tones. | + | Generates a square wave of the specified frequency (and 50% duty cycle) on a pin. A duration can be specified, otherwise the wave continues until a call to [[arduino:advanced io:NoTone]]. The pin can be connected to a piezo buzzer or other speaker to play tones. |
Only one tone can be generated at a time. If a tone is already playing on a different pin, the call to tone() will have no effect. If the tone is playing on the same pin, the call will set its frequency. | Only one tone can be generated at a time. If a tone is already playing on a different pin, the call to tone() will have no effect. If the tone is playing on the same pin, the call will set its frequency. |