Defines | |
#define | C4 260 |
Middle C. | |
#define | C4s 277 |
C#. | |
#define | D4 294 |
D. | |
#define | D4s 311 |
D#. | |
#define | E4 330 |
E. | |
#define | F4 349 |
F. | |
#define | F4s 370 |
F#. | |
#define | G4 392 |
G. | |
#define | G4s 415 |
G#. | |
#define | A4 440 |
A. | |
#define | A4s 466 |
A#. | |
#define | B4 494 |
B. | |
#define | C5 523 |
C. | |
Functions | |
void | buzzer_init (void) |
Initialize the buzzer. | |
void | buzzer_set_val (unsigned int buzz_value) |
Set the value the buzzer plays. | |
void | buzzer_set_freq (unsigned int buzz_freq) |
Set the frequency the buzzer plays. | |
void | buzzer_chirp (unsigned int ms, unsigned int buzz_freq) |
Play a frequency for a specified time. | |
void | buzzer_off (void) |
Turn the buzzer off. |
void buzzer_chirp | ( | unsigned int | ms, | |
unsigned int | buzz_freq | |||
) |
Play a frequency for a specified time.
Plays the specified frequency for the specified amount of time. This function blocks execution until the time is completed. buzzer_init must be called before this function can be used.
ms | the time in milliseconds to play the frequency | |
buzz_freq | the frequency to play |
void buzzer_init | ( | void | ) |
Initialize the buzzer.
Initializes the buzzer. Must be called before any other buzzer function may be used.
void buzzer_off | ( | ) |
void buzzer_set_freq | ( | unsigned int | buzz_freq | ) |
Set the frequency the buzzer plays.
Sets the buzzer frequency. Usage of constants such as C4 is highly recommended as input to this function. buzzer_init must be called before this function may be used.
buzz_freq | the frequency to set the buzzer to |
void buzzer_set_val | ( | unsigned int | buzz_value | ) |
Set the value the buzzer plays.
Sets the value of the buzzer's pitch. Higher values are lower frequencies.
buzz_value | the value to set the buzzer's frequency too, in the range 0-255 |