// 27 July 2024.
// Testing the dependencies of the LcdMenu library by forntoh.
// Sketch taken from:
// https://github.com/forntoh/LcdMenu/tree/master/examples/Basic
//
// For a working project (with the library as local files), see:
// https://wokwi.com/projects/404568149573227521
/*
Basic Menu
https://lcdmenu.forntoh.dev/examples/basic
*/
#include <LcdMenu.h>
#include <utils/commandProccesors.h>
#define LCD_ROWS 2
#define LCD_COLS 16
// Configure keyboard keys (ASCII)
#define UP 56 // NUMPAD 8
#define DOWN 50 // NUMPAD 2
#define ENTER 53 // NUMPAD 5
#define BACK 55 // NUMPAD 7
// Initialize the main menu items
MAIN_MENU(
ITEM_BASIC("Start service"),
ITEM_BASIC("Connect to WiFi"),
ITEM_BASIC("Settings"),
ITEM_BASIC("Blink SOS"),
ITEM_BASIC("Blink random")
);
// Construct the LcdMenu
LcdMenu menu(LCD_ROWS, LCD_COLS);
void setup() {
Serial.begin(9600);
// Initialize LcdMenu with the menu items
menu.setupLcdWithMenu(0x27, mainMenu);
}
void loop() {
if (!Serial.available()) return;
char command = Serial.read();
processMenuCommand(menu, command, UP, DOWN, ENTER, BACK);
}
Testing the dependencies of the LcdMenu library by forntoh