55static void sound(
int freq,
int ms) {
88void beep(
int freq,
int ms) {
107 int noteDuration = 0;
111 const int divider = melody[i + 1];
116 else if (divider > 0) {
120 else if (divider < 0) {
126 beep(melody[i], noteDuration * 0.9);
148 const int PauseMs = 200;
149 const int ToneMs = 150;
154 for (n = 0; n < 5; n++) {
159 else if (batPct > 78) {
161 for (n = 0; n < 4; n++) {
166 else if (batPct > 58) {
168 for (n = 0; n < 3; n++) {
173 else if (batPct > 38) {
175 for (n = 0; n < 2; n++) {
180 else if (batPct > 18) {
182 for (n = 0; n < 1; n++) {
static const int WholeNote
Duration of a whole note.
void playDisconnect(void)
static void sound(int freq, int ms)
static void silence(void)
void beep(int freq, int ms)
static int buzzerPin
Buzzer pin to be used.
void playMelody(const int melody[])
void playBattery(float batPct)
Pin definitions for Seeed XIAO nRF52840 2.9.2 with Adafruit bluefruit library.
Varios methods to produce the buzzer sounds.