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

Go to the source code of this file.

Functions

void brightnessSelectFunction (enum menuItem::encoderState_t state)
 Behaviour override for brightness selection. More...
 
void brightnessSelectDrawFunction (ssd1306 *oled)
 Draw override for brightness selection. More...
 
void rainbowMenuSelectFunction (enum menuItem::encoderState_t state)
 Behaviour override for rainbow menu select. More...
 
void candleMenuSelectFunction (enum menuItem::encoderState_t state)
 Behaviour override for candle menu select. More...
 
void pulseMenuSelectFunction (enum menuItem::encoderState_t state)
 Behaviour override for pulse menu select. More...
 
void musicMenuSelectFunction (enum menuItem::encoderState_t state)
 Behaviour override for music menu select. More...
 
void komodoMenuSelectFunction (enum menuItem::encoderState_t state)
 Behaviour override for komodo menu select. More...
 
void colorMenuSelectFunction (enum menuItem::encoderState_t state)
 Behaviour override for color mode menu. More...
 
void colorSelectFunction (enum menuItem::encoderState_t state)
 Behaviour override for color select menu. More...
 
void colorSelectDrawFunction (ssd1306 *oled)
 Draw override for color select menu. More...
 
void buzzerMenuSelectedFunction (enum menuItem::encoderState_t state)
 Behaviour override for buzzer menu. More...
 
void clapMenuSelectedFunction (enum menuItem::encoderState_t state)
 Behaviour override for clap menu. More...
 
void fogEnableMenuSelectedFunction (enum menuItem::encoderState_t state)
 
void fogTimerSelectFunction (enum menuItem::encoderState_t state)
 Behaviour override for fog timer setting menu. More...
 
void fogTimerSelectDrawFunction (ssd1306 *oled)
 Draw override for fog timer setting. More...
 
void menuInit ()
 Initialize the menu system. More...
 

Variables

const char fogTimer15minText[] PROGMEM = "15 min"
 Fog timer text for 15 min. More...
 
enum lightMode_t lightMode = LIGHT_MODE_RAINBOW
 It will store the user selected light mode. More...
 
uint8_t selectedColor = 0
 It will store the user selected color. More...
 
uint8_t lightBrightness = 30
 It will store the user selected brightness. More...
 
bool buzzerEnabled = true
 It will store the user selected state of the buzzer. More...
 
bool clapSwitchEnabled = true
 It will store the user selected state of the clap switch. More...
 
bool fogMachineEnabled = true
 It will store the user selected state of the fog machine. More...
 
uint8_t fogTimer = 0
 It will store the user selected humidification period. More...
 
menuItem mainMenuItem (mainMenuItemText)
 
menuItem lightMenuItem (lightMenuItemText)
 
menuItem brightnessMenuItem (brightnessMenuItemText)
 
menuItem brightnessSelectItem (brightnessSelectItemText)
 
menuItem buzzerMenuItem (buzzerMenuItemText)
 
menuItem clapMenuItem (clapMenuItemText)
 
menuItem fogEnableMenuItem (fogEnableMenuItemText)
 
menuItem fogTimerMenuItem (fogTimerMenuItemText)
 
menuItem fogTimerSelectMenuItem (fogTimerSelectMenuItemText)
 
menuItem lightModeMenuItem (lightModeMenuItemText)
 
menuItem rainbowModeMenuItem (rainbowModeMenuItemText)
 
menuItem candleModeMenuItem (candleModeMenuItemText)
 
menuItem pulseModeMenuItem (pulseModeMenuItemText)
 
menuItem musicModeMenuItem (musicModeMenuItemText)
 
menuItem komodoModeMenuItem (komodoModeMenuItemText)
 
menuItem colorModeMenuItem (colorModeMenuItemText)
 
menuItem colorSelectMenuItem (colorSelectMenuItemText)
 

Function Documentation

◆ brightnessSelectDrawFunction()

void brightnessSelectDrawFunction ( ssd1306 oled)

Draw override for brightness selection.

This function will be called by the brightnessSelectItem when it's content has to be drawn.

Parameters
oledPointer to the display controller object. The function acces the display through this pointer.

Definition at line 405 of file menu.cpp.

Here is the caller graph for this function:

◆ brightnessSelectFunction()

void brightnessSelectFunction ( enum menuItem::encoderState_t  state)

Behaviour override for brightness selection.

This function will be called by the brightnessSelectItem when it is selected and any interaction happens with the menu.

Parameters
stateEvent, that describes what kind of interaction happened.

Definition at line 375 of file menu.cpp.

Here is the caller graph for this function:

◆ buzzerMenuSelectedFunction()

void buzzerMenuSelectedFunction ( enum menuItem::encoderState_t  state)

Behaviour override for buzzer menu.

This function will be called by the buzzerMenuItem when it is selected and any interaction happens with the menu.

Parameters
stateEvent, that describes what kind of interaction happened.

Definition at line 615 of file menu.cpp.

Here is the caller graph for this function:

◆ candleMenuSelectFunction()

void candleMenuSelectFunction ( enum menuItem::encoderState_t  state)

Behaviour override for candle menu select.

This function will be called by the candleModeMenuItem when it is selected and any interaction happens with the menu.

Parameters
stateEvent, that describes what kind of interaction happened.

Definition at line 460 of file menu.cpp.

Here is the caller graph for this function:

◆ clapMenuSelectedFunction()

void clapMenuSelectedFunction ( enum menuItem::encoderState_t  state)

Behaviour override for clap menu.

This function will be called by the clapMenuItem when it is selected and any interaction happens with the menu.

Parameters
stateEvent, that describes what kind of interaction happened.

Definition at line 640 of file menu.cpp.

Here is the caller graph for this function:

◆ colorMenuSelectFunction()

void colorMenuSelectFunction ( enum menuItem::encoderState_t  state)

Behaviour override for color mode menu.

This function will be called by the colorModeMenuItem when it is selected and any interaction happens with the menu.

Parameters
stateEvent, that describes what kind of interaction happened.

Definition at line 540 of file menu.cpp.

Here is the caller graph for this function:

◆ colorSelectDrawFunction()

void colorSelectDrawFunction ( ssd1306 oled)

Draw override for color select menu.

This function will be called by the colorSelectMenuItem when it's content has to be drawn.

Parameters
oledPointer to the display controller object. The function acces the display through this pointer.

Definition at line 590 of file menu.cpp.

Here is the caller graph for this function:

◆ colorSelectFunction()

void colorSelectFunction ( enum menuItem::encoderState_t  state)

Behaviour override for color select menu.

This function will be called by the colorSelectMenuItem when it is selected and any interaction happens with the menu.

Parameters
stateEvent, that describes what kind of interaction happened.

Definition at line 560 of file menu.cpp.

Here is the caller graph for this function:

◆ fogEnableMenuSelectedFunction()

void fogEnableMenuSelectedFunction ( enum menuItem::encoderState_t  state)

Definition at line 665 of file menu.cpp.

Here is the caller graph for this function:

◆ fogTimerSelectDrawFunction()

void fogTimerSelectDrawFunction ( ssd1306 oled)

Draw override for fog timer setting.

This function will be called by the fogTimerSelectMenuItem when it's content has to be drawn.

Parameters
oledPointer to the display controller object. The function acces the display through this pointer.

Definition at line 721 of file menu.cpp.

Here is the caller graph for this function:

◆ fogTimerSelectFunction()

void fogTimerSelectFunction ( enum menuItem::encoderState_t  state)

Behaviour override for fog timer setting menu.

This function will be called by the fogTimerSelectMenuItem when it is selected and any interaction happens with the menu.

Parameters
stateEvent, that describes what kind of interaction happened.

Definition at line 691 of file menu.cpp.

Here is the caller graph for this function:

◆ komodoMenuSelectFunction()

void komodoMenuSelectFunction ( enum menuItem::encoderState_t  state)

Behaviour override for komodo menu select.

This function will be called by the komodoModeMenuItem when it is selected and any interaction happens with the menu.

Parameters
stateEvent, that describes what kind of interaction happened.

Definition at line 520 of file menu.cpp.

Here is the caller graph for this function:

◆ menuInit()

void menuInit ( )

Initialize the menu system.

Todo:
Maybe a menu map can visualize the behaviour of the ton of settings. It's a huge graph, yED could do that I think.

Definition at line 807 of file menu.cpp.

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

◆ musicMenuSelectFunction()

void musicMenuSelectFunction ( enum menuItem::encoderState_t  state)

Behaviour override for music menu select.

This function will be called by the musicModeMenuItem when it is selected and any interaction happens with the menu.

Parameters
stateEvent, that describes what kind of interaction happened.

Definition at line 500 of file menu.cpp.

Here is the caller graph for this function:

◆ pulseMenuSelectFunction()

void pulseMenuSelectFunction ( enum menuItem::encoderState_t  state)

Behaviour override for pulse menu select.

This function will be called by the pulseModeMenuItem when it is selected and any interaction happens with the menu.

Parameters
stateEvent, that describes what kind of interaction happened.

Definition at line 480 of file menu.cpp.

Here is the caller graph for this function:

◆ rainbowMenuSelectFunction()

void rainbowMenuSelectFunction ( enum menuItem::encoderState_t  state)

Behaviour override for rainbow menu select.

This function will be called by the rainbowModeMenuItem when it is selected and any interaction happens with the menu.

Parameters
stateEvent, that describes what kind of interaction happened.

Definition at line 440 of file menu.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ brightnessMenuItem

menuItem brightnessMenuItem(brightnessMenuItemText) ( brightnessMenuItemText  )

◆ brightnessSelectItem

menuItem brightnessSelectItem(brightnessSelectItemText) ( brightnessSelectItemText  )

◆ buzzerEnabled

bool buzzerEnabled = true

It will store the user selected state of the buzzer.

Definition at line 50 of file menu.cpp.

◆ buzzerMenuItem

menuItem buzzerMenuItem(buzzerMenuItemText) ( buzzerMenuItemText  )

◆ candleModeMenuItem

menuItem candleModeMenuItem(candleModeMenuItemText) ( candleModeMenuItemText  )

◆ clapMenuItem

menuItem clapMenuItem(clapMenuItemText) ( clapMenuItemText  )

◆ clapSwitchEnabled

bool clapSwitchEnabled = true

It will store the user selected state of the clap switch.

Definition at line 52 of file menu.cpp.

◆ colorModeMenuItem

menuItem colorModeMenuItem(colorModeMenuItemText) ( colorModeMenuItemText  )

◆ colorSelectMenuItem

menuItem colorSelectMenuItem(colorSelectMenuItemText) ( colorSelectMenuItemText  )

◆ fogEnableMenuItem

menuItem fogEnableMenuItem(fogEnableMenuItemText) ( fogEnableMenuItemText  )

◆ fogMachineEnabled

bool fogMachineEnabled = true

It will store the user selected state of the fog machine.

Definition at line 54 of file menu.cpp.

◆ fogTimer

uint8_t fogTimer = 0

It will store the user selected humidification period.

  • 0 -> 15 min
  • 1 -> 30 min
  • 2 -> 45 min
  • 3 -> 1 hour
  • 4 -> 1 hour 30 min
  • 5 -> 2 hour
  • 6 -> 3 hour
  • 7 -> 5 hour
  • 8 -> 8 hour
  • 9 -> 12 hour
  • 10 -> 24 hour
    Todo:
    It looks like I haven't added this to the configuration yet. Maybe I should?

Definition at line 56 of file menu.cpp.

◆ fogTimerMenuItem

menuItem fogTimerMenuItem(fogTimerMenuItemText) ( fogTimerMenuItemText  )

◆ fogTimerSelectMenuItem

menuItem fogTimerSelectMenuItem(fogTimerSelectMenuItemText) ( fogTimerSelectMenuItemText  )

◆ komodoModeMenuItem

menuItem komodoModeMenuItem(komodoModeMenuItemText) ( komodoModeMenuItemText  )

◆ lightBrightness

uint8_t lightBrightness = 30

It will store the user selected brightness.

Definition at line 48 of file menu.cpp.

◆ lightMenuItem

menuItem lightMenuItem(lightMenuItemText) ( lightMenuItemText  )

◆ lightMode

enum lightMode_t lightMode = LIGHT_MODE_RAINBOW

It will store the user selected light mode.

Definition at line 44 of file menu.cpp.

◆ lightModeMenuItem

menuItem lightModeMenuItem(lightModeMenuItemText) ( lightModeMenuItemText  )

◆ mainMenuItem

menuItem mainMenuItem(mainMenuItemText) ( mainMenuItemText  )

◆ musicModeMenuItem

menuItem musicModeMenuItem(musicModeMenuItemText) ( musicModeMenuItemText  )

◆ PROGMEM

const char colorSelectMenuItemText [] PROGMEM = "15 min"

Fog timer text for 15 min.

Fog timer text for 24 hour.

Fog timer text for 12 hour.

Fog timer text for 8 hour.

Fog timer text for 5 hour.

Fog timer text for 3 hour.

Fog timer text for 2 hour.

Fog timer text for 1 hour 30 min.

Fog timer text for 1 hour.

Fog timer text for 45 min.

Fog timer text for 30 min.

Definition at line 32 of file menu.cpp.

◆ pulseModeMenuItem

menuItem pulseModeMenuItem(pulseModeMenuItemText) ( pulseModeMenuItemText  )

◆ rainbowModeMenuItem

menuItem rainbowModeMenuItem(rainbowModeMenuItemText) ( rainbowModeMenuItemText  )

◆ selectedColor

uint8_t selectedColor = 0

It will store the user selected color.

Definition at line 46 of file menu.cpp.