Viking Skull Lamp  V1.0.1
Loading...
Searching...
No Matches
main.cpp File Reference
#include "main.hpp"

Go to the source code of this file.

Functions

void setup ()
 Device initialization section after reset. More...
 
void loop ()
 This is the infinite loop of the code. More...
 
void encoderISR ()
 Interrupt service for the encoder rotation events. More...
 
void encoderButtonUpdate ()
 This function handles the button press detection. More...
 

Variables

ssd1306 display (OLED_ADDRESS)
 Object for the display. More...
 
configurationManager::configurationData_t configTree []
 This array contains all the variables, that required for configuring the device. More...
 
configurationManager config (configTree,(sizeof(configTree)/sizeof(configTree[0])))
 Object for configuration saving and loading. More...
 
long lastButtonPress = 0
 Last system time when the button was pressed. More...
 
uint8_t buttonPressCntr = 0
 Counts how many button press was detected in a period. More...
 
bool buttonPressed = false
 Flag for button press detection. More...
 

Function Documentation

◆ encoderButtonUpdate()

void encoderButtonUpdate ( )

This function handles the button press detection.

Definition at line 190 of file main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ encoderISR()

void encoderISR ( )

Interrupt service for the encoder rotation events.

Definition at line 160 of file main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loop()

void loop ( )

This is the infinite loop of the code.

Every periodic task should be placed here.

Definition at line 141 of file main.cpp.

Here is the call graph for this function:

◆ setup()

void setup ( )

Device initialization section after reset.

Definition at line 80 of file main.cpp.

Here is the call graph for this function:

Variable Documentation

◆ buttonPressCntr

uint8_t buttonPressCntr = 0

Counts how many button press was detected in a period.

Definition at line 74 of file main.cpp.

◆ buttonPressed

bool buttonPressed = false

Flag for button press detection.

Definition at line 77 of file main.cpp.

◆ config

configurationManager config(configTree,(sizeof(configTree)/sizeof(configTree[0]))) ( configTree  ,
(sizeof(configTree)/sizeof(configTree[0]))   
)

Object for configuration saving and loading.

This object handles the saving and the loading loading of the configuration data. It uses the configTree array, which contains all the configuration associated variables.

◆ configTree

Initial value:
= {
}
#define createData(x)
enum lightMode_t lightMode
It will store the user selected light mode.
Definition: menu.cpp:44
uint8_t lightBrightness
It will store the user selected brightness.
Definition: menu.cpp:48
bool fogMachineEnabled
It will store the user selected state of the fog machine.
Definition: menu.cpp:54
uint8_t selectedColor
It will store the user selected color.
Definition: menu.cpp:46
bool buzzerEnabled
It will store the user selected state of the buzzer.
Definition: menu.cpp:50
bool clapSwitchEnabled
It will store the user selected state of the clap switch.
Definition: menu.cpp:52

This array contains all the variables, that required for configuring the device.

Definition at line 51 of file main.cpp.

◆ display

menu menuController & display ( OLED_ADDRESS  )

Object for the display.

Object for the menu.

This object can control a 128 x 32 pixel oled display whisch have an SSD1306 display driver. The address is configurable in the OLED_ADDRESS macro.

See also
OLED_ADDRESS

This object handles all the logic behind the menu system. It uses the display object as output and the default selected menu item is lightMenuItem

Definition at line 47 of file main.cpp.

◆ lastButtonPress

long lastButtonPress = 0

Last system time when the button was pressed.

Definition at line 71 of file main.cpp.