boothifier/include/my_buzzer.h
2025-09-07 23:38:56 -07:00

40 lines
602 B
C

#pragma once
#include <ArduinoJson.h>
typedef enum {
TUNE_BOOT,
TUNE_SHUTDOWN,
TUNE_CONNECTED,
TUNE_DISCONNECTED,
TUNE_DONE,
TUNE_WARNING,
TUNE_ERROR,
TUNE_BLIP,
TUNE_THUMP,
TUNE_ACK,
TUNE_WAITING,
TUNE_LOWBEEP,
TUNE_HIGHBEEP
}TUNE_TYPE;
//Tunes
typedef struct {
int cycles;
int pause;
String melody;
}BUZZ_TUNE;
#define TUNE_MAX_COUNT 14
extern BUZZ_TUNE buzzTune[TUNE_MAX_COUNT];
void Init_Buzzer(int8_t pin, const char* configPath, int8_t channel = -1);
void Buzzer_Load_Tunes(const char* tunesPath);
void Buzzer_Play_Tune(TUNE_TYPE tune, int priority=1);