Basic

 1#include <LcdMenu.h>
 2#include <MenuScreen.h>
 3#include <display/LiquidCrystal_I2CAdapter.h>
 4#include <input/KeyboardAdapter.h>
 5#include <renderer/CharacterDisplayRenderer.h>
 6
 7#define LCD_ROWS 2
 8#define LCD_COLS 16
 9
10// Initialize the main menu items
11// clang-format off
12MENU_SCREEN(mainScreen, mainItems,
13    ITEM_BASIC("Start service"),
14    ITEM_BASIC("Connect to WiFi"),
15    ITEM_BASIC("Settings"),
16    ITEM_BASIC("Blink SOS"),
17    ITEM_BASIC("Blink random"));
18// clang-format on
19
20LiquidCrystal_I2C lcd(0x27, LCD_COLS, LCD_ROWS);
21CharacterDisplayRenderer renderer(new LiquidCrystal_I2CAdapter(&lcd), LCD_COLS, LCD_ROWS);
22LcdMenu menu(renderer);
23KeyboardAdapter keyboard(&menu, &Serial);
24
25void setup() {
26    Serial.begin(9600);
27    // Initialize LcdMenu with the menu items
28    renderer.begin();
29    menu.setScreen(mainScreen);
30}
31
32void loop() {
33    keyboard.observe();
34}