Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

MenuCreator

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.


โœจ Features

  • ๐Ÿ“Ÿ Supports LiquidCrystal LCD 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

๐Ÿ“ฆ Installation

Arduino IDE Library Manager

Search for:

MenuCreator

Manual Installation

  1. Download ZIP
  2. Open Arduino IDE
  3. Go to:
Sketch > Include Library > Add .ZIP Library

๐Ÿ”Œ Supported Hardware

Boards

  • Arduino Uno
  • Arduino Nano
  • Arduino Mega
  • ESP8266 / ESP32 (Arduino framework)
  • Any Arduino-compatible board

LCD Displays

  • 16x2 LCD
  • 20x4 LCD
  • Any LiquidCrystal compatible display

๐Ÿš€ Full Configuration Example

#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();
}

โš™๏ธ Complete Configuration Guide

๐Ÿ“Ÿ LCD Object

LiquidCrystal MenuCreator::lcd(12,11,5,4,3,2);

Set LCD connection pins.

Format:

LiquidCrystal MenuCreator::lcd(RS, EN, D4, D5, D6, D7);

๐Ÿ”˜ Button Pins

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

๐Ÿ”Œ Trigger Mode

int MenuCreator::IP_MODE = LOW;

Options

LOW
HIGH

Use:

  • LOW โ†’ For pull-up buttons (recommended)
  • HIGH โ†’ For normal trigger buttons

๐Ÿ“ LCD Size

short MenuCreator::COL = 16;
short MenuCreator::ROW = 2;

Examples:

16x2
20x4
16x4

โฑ Timeout

unsigned long MenuCreator::timeout = 60;

If no button pressed for 60 seconds, screen returns to idle mode.


๐Ÿ’ค Idle Screen Messages

MenuCreator::setIdealText(0, "Welcome");
MenuCreator::setIdealText(1, "Select Menu");

Format

setIdealText(lineNumber, "message");

Example:

setIdealText(0, "My Device");
setIdealText(1, "Ready");

๐Ÿ“‚ Create Menus

MenuCreator root;
MenuCreator settings;
MenuCreator info;
MenuCreator wifi;

๐ŸŒณ Create Tree Structure

root.appendChild(&settings);
root.appendChild(&info);

settings.appendChild(&wifi);

๐Ÿท Set Menu Text

settings << "Settings";
info << "Info";
wifi << "WiFi Setup";

โšก Attach Callback

info.attachCallBack(myFunction);

When selected, function runs.

Example:

void myFunction()
{
   Serial.println("Pressed");
}

๐Ÿ”„ Main Loop

void loop()
{
   MenuCreator::butProcess();
}

Must call continuously.


๐Ÿ“‹ Available Functions

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

๐ŸŽฎ Navigation Example

UP      -> Previous item
DOWN    -> Next item
OK      -> Enter / Run
BACK    -> Go back

๐Ÿ“œ License

This 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:

scicopath01@gmail.com


๐Ÿ‘จโ€๐Ÿ’ป Author

Jayasankar JP


โญ Support

If you like this project:

  • Star repository
  • Share with Arduino developers
  • Improve library
  • Submit pull requests

About

Arduino program for Display Menu Creator

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages