Buzzer Control#
Sample API functions for playing tunes on a piezo buzzer.
See buzzer.h for source code.
Note Definitions#
Flats are used instead of sharps because # is a special character.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
A note which can be used in tune structure definitions.
Functions#
Plays a tune on the piezo buzzer.
Causes something to happen on a node (such as playing a tune on the buzzer) that can be used to indicate where it physically is.
Note Definitions Documentation#
Function Documentation#
halPlayTune_P#
void halPlayTune_P (uint8_t PGM * tune, bool bkg)
Plays a tune on the piezo buzzer.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t PGM * | N/A | tune | A pointer to tune to play. |
bool | N/A | bkg | Determines whether the tune plays in the background. If true, tune plays in background; if false, tune plays in foreground. |
The tune is played in the background if ::bkg is true. Otherwise, the API blocks until the playback of the tune is complete. halPlayTune_P() is not meant to be called back-to-back.
A tune is implemented as follows:
uint8_t PGM hereIamTune[] = { //All tunes are stored in flash.
NOTE_B4, 1, //Plays the note B4 for 100 milliseconds.
0, 1, //Pause for 100 milliseconds.
NOTE_B5, 5, //Plays the note B5 for 500 milliseconds.
0, 0 //NULL terminates the tune.
};
halStackIndicatePresence#
void halStackIndicatePresence (void )
Causes something to happen on a node (such as playing a tune on the buzzer) that can be used to indicate where it physically is.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |