24#include "../square_wave.h"
API class for tone generation to a buzzer (or better an amplifier) connected to pin OUTPUT.
ToneGenerator()=default
Create a new generator of tones.
typename SQWGEN::TIMER::TYPE COUNTER
The counter type (uint8_t or uint16_t) for the selected NTIMER.
void stop_tone()
Stop the tone being currently generated to the connected buzzer.
void start_tone(Tone tone)
Start generating a tone on the connected buzzer until stop_tone() is called.
void start_tone(PRESCALER prescaler, COUNTER counter)
Start generating a tone on the connected buzzer until stop_tone() is called.
typename SQWGEN::TIMER::PRESCALER PRESCALER
The TimerPrescaler type matching the selected NTIMER.
void start_frequency(uint32_t frequency)
Start producing, on the ouput pin, a square wave with the specified frequency.
void stop()
Stop square wave generation.
Defines API for audio tones (square waves) generation and simple melodies playing.
Tone
This enum defines all possible audio tones that can be generated.
Defines all API for all external devices supported by FastArduino.