17#include <IntervalTimer.h>
29template <u
int8_t menuCount>
Manages multiple menus and settings using Adafruit NeoTrellis.
static bool Initialize(uint8_t pin, uint16_t holdingTime)
Initializes the MenuHandler with specified parameters.
static void UpdateState()
Updates the button state and menu navigation.
static void WriteEEPROM(uint16_t index, uint8_t value)
Writes a value to EEPROM at the specified index.
static void SetInitialized()
Marks the menu system as initialized.
static void SetMenuMax(uint8_t menu, uint8_t maxValue)
Sets the maximum value for a specific menu.
static long previousMillisHold
Tracks the last hold event time in milliseconds.
static uint8_t currentMenu
Index of the currently active menu.
static uint8_t GetMenuValue(uint8_t menu)
Retrieves the current value of a specific menu.
static uint8_t maxValue[menuCount]
Array of maximum values for each menu.
static uint8_t pin
The pin number associated with the button.
static void Begin()
Begins the menu handling process, setting up necessary states.
static IntervalTimer menuChangeTimer
Timer for handling menu change intervals.
static bool previousState
Tracks the previous state of the button.
static uint8_t GetCurrentMenu()
Retrieves the index of the currently active menu.
static uint16_t holdingTime
Time threshold for detecting holding behavior in milliseconds.
static bool holdingState
Indicates whether the button is in a holding state.
static void SetDefaultValue(uint16_t menu, uint8_t value)
Sets a default value for a specific menu.
static uint8_t currentValue[menuCount]
Array of current values for each menu.
static uint8_t ReadEEPROM(uint16_t index)
Reads a value from EEPROM at the specified index.