83 wdt_enable( WDTO_4S );
86 Serial.begin( 115200 );
109 Serial.println( F(
"Display Error!" ) );
void encoderRotateSound()
Generate encoder rotate sound.
void turnOnMelody()
Generate turn on sound.
void buttonClickSound()
Generate button click sound.
void openCloseMelody()
Generate open-close melody.
Configuration Manager Class.
bool loadConfig()
Load configuration from EEPROM.
void saveConfig()
Save configuration to EEPROM.
bool begin()
Init function for the display.
void fogMachineInit()
Initialize the fog machine( humidifier ).
void fogMachineUpdate()
Update the fog machine state.
menu menuController
Object for the menu.
void lightInit()
Initialize the LEDs.
void lightUpdate()
Update function for the lighting.
void lightToggle()
Toggle the lighting.
long lastButtonPress
Last system time when the button was pressed.
void encoderButtonUpdate()
This function handles the button press detection.
ssd1306 display(OLED_ADDRESS)
Object for the display.
void setup()
Device initialization section after reset.
bool buttonPressed
Flag for button press detection.
uint8_t buttonPressCntr
Counts how many button press was detected in a period.
configurationManager::configurationData_t configTree[]
This array contains all the variables, that required for configuring the device.
void encoderISR()
Interrupt service for the encoder rotation events.
configurationManager config(configTree,(sizeof(configTree)/sizeof(configTree[0])))
Object for configuration saving and loading.
void loop()
This is the infinite loop of the code.
#define ENCODER_DATA
The encoder data line is connected to pin 4 on the Arduino.
#define ENCODER_CLK
The encoder clock line is connected to pin 3 on the Arduino.
#define DEFAULT_CLAP_SWITCH_STATE
By default the clap switch is enabled.
#define DEFAULT_LIGHT_BRIGHTNESS
Default value for the brightness.
#define DEFAULT_SELECTED_COLOR
Default value for the user selected color.
#define DEFAULT_BUZZER_STATE
By default the buzzer is enabled.
#define DEFAULT_LIGHT_MODE
Default value for the light mode.
#define ENCODER_BTN
The encoder button is connected to pin 2 on the Arduino.
#define DEFAULT_FOG_STATE
By default the fog machine is enabled.
void closeFront()
Close the font.
enum frontState_t frontState
Store the state of the front panel.
void motorInit()
Initialize the motor.
void openFront()
Open the font.
@ FRONT_OPEN
Front is opened.
Type for configTree element.