MenuCreator is an Arduino LCD menu library that helps you build hierarchical menu systems using push buttons and a LiquidCrystal display.
It is designed for fast menu creation with simple syntax, callback support, nested menus, idle screen messages, and easy navigation.
- ๐ Supports
LiquidCrystalLCD displays - ๐ Multi-level menu system
- ๐ Button navigation (UP / DOWN / OK / BACK)
- โก Callback function support
- ๐งฉ Easy child-parent menu linking
- ๐ค Idle screen message support
- โฑ Auto timeout to idle mode
- ๐ Lightweight and simple API
Search for:
MenuCreator- Download ZIP
- Open Arduino IDE
- Go to:
Sketch > Include Library > Add .ZIP Library- Arduino Uno
- Arduino Nano
- Arduino Mega
- ESP8266 / ESP32 (Arduino framework)
- Any Arduino-compatible board
- 16x2 LCD
- 20x4 LCD
- Any
LiquidCrystalcompatible display
#include <MenuCreator.h>
/* LCD Pins: RS, EN, D4, D5, D6, D7 */
LiquidCrystal MenuCreator::lcd(12, 11, 5, 4, 3, 2);
/* Button Pins */
int MenuCreator::UP = 8;
int MenuCreator::DOWN = 9;
int MenuCreator::OK = 10;
int MenuCreator::BACK = 13;
/* Trigger Mode */
int MenuCreator::IP_MODE = LOW; // LOW = Active LOW buttons
/* LCD Size */
short MenuCreator::COL = 16;
short MenuCreator::ROW = 2;
/* Idle Timeout (seconds) */
unsigned long MenuCreator::timeout = 60;
/* Menu Objects */
MenuCreator root;
MenuCreator Menu1;
MenuCreator Menu2;
MenuCreator Menu3;
MenuCreator Menu4;
MenuCreator Menu5;
/* Callback Functions */
void fun2(){ Serial.println("Menu2 Pressed"); }
void fun3(){ Serial.println("Menu3 Pressed"); }
void fun4(){ Serial.println("Menu4 Pressed"); }
void fun5(){ Serial.println("Menu5 Pressed"); }
void setup()
{
Serial.begin(9600);
MenuCreator::init();
MenuCreator::setRoot(&root);
/* Build Menu Tree */
root.appendChild(&Menu1);
root.appendChild(&Menu2);
root.appendChild(&Menu3);
Menu1.appendChild(&Menu4);
Menu1.appendChild(&Menu5);
/* Menu Names */
Menu1 << "Settings";
Menu2 << "Status";
Menu3 << "About";
Menu4 << "WiFi";
Menu5 << "Reset";
/* Attach Functions */
Menu2.attachCallBack(fun2);
Menu3.attachCallBack(fun3);
Menu4.attachCallBack(fun4);
Menu5.attachCallBack(fun5);
/* Idle Messages */
MenuCreator::setIdealText(0, "Welcome");
MenuCreator::setIdealText(1, "Select Option");
}
void loop()
{
MenuCreator::butProcess();
}LiquidCrystal MenuCreator::lcd(12,11,5,4,3,2);Set LCD connection pins.
Format:
LiquidCrystal MenuCreator::lcd(RS, EN, D4, D5, D6, D7);int MenuCreator::UP = 8;
int MenuCreator::DOWN = 9;
int MenuCreator::OK = 10;
int MenuCreator::BACK = 13;Assign button input pins.
| Button | Function |
|---|---|
| UP | Previous menu |
| DOWN | Next menu |
| OK | Enter / Execute |
| BACK | Previous level |
int MenuCreator::IP_MODE = LOW;LOW
HIGHUse:
LOWโ For pull-up buttons (recommended)HIGHโ For normal trigger buttons
short MenuCreator::COL = 16;
short MenuCreator::ROW = 2;Examples:
16x2
20x4
16x4unsigned long MenuCreator::timeout = 60;If no button pressed for 60 seconds, screen returns to idle mode.
MenuCreator::setIdealText(0, "Welcome");
MenuCreator::setIdealText(1, "Select Menu");setIdealText(lineNumber, "message");Example:
setIdealText(0, "My Device");
setIdealText(1, "Ready");MenuCreator root;
MenuCreator settings;
MenuCreator info;
MenuCreator wifi;root.appendChild(&settings);
root.appendChild(&info);
settings.appendChild(&wifi);settings << "Settings";
info << "Info";
wifi << "WiFi Setup";info.attachCallBack(myFunction);When selected, function runs.
Example:
void myFunction()
{
Serial.println("Pressed");
}void loop()
{
MenuCreator::butProcess();
}Must call continuously.
| Function | Description |
|---|---|
init() |
Initialize LCD and buttons |
setRoot() |
Set first menu |
appendChild() |
Add submenu |
attachCallBack() |
Attach function |
setIdealText() |
Set idle message |
butProcess() |
Process buttons |
<< |
Set menu text |
UP -> Previous item
DOWN -> Next item
OK -> Enter / Run
BACK -> Go backThis software is licensed under the GNU GPL v3 for open-source use.
Any use of this software in closed-source or proprietary applications requires a separate commercial license from the author.
To obtain a commercial license, please contact:
Jayasankar JP
If you like this project:
- Star repository
- Share with Arduino developers
- Improve library
- Submit pull requests