• Stars
    star
    171
  • Rank 221,594 (Top 5 %)
  • Language
    C++
  • License
    MIT License
  • Created over 4 years ago
  • Updated 5 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Display navigable menu items on your LCD display 📟 with Arduino

LcdMenu 📟

arduino-library-badge PlatformIO Registry

LcdMenu is an Arduino library that enables you to create interactive menus and navigation systems for LCD displays. With LcdMenu, you can easily add menus to your projects and navigate through them using buttons or any input device you want. The library supports a wide range of LCD display modules, including character and alphanumeric displays.

Basic

Features

  • Dynamic menus: Create menus with multiple levels and submenus.
  • Multiple menu types: Choose from different menu types such as command, toggle, and input.
  • Callback functions: Assign functions to menu items to execute specific tasks when triggered.

Installation

Follow this guide to install the library with Arduino Library Manager or install it with PlatformIO using the steps below:

  1. Open the PlatformIO IDE or VSCode with PlatformIO extension installed.

  2. Create a new project or open an existing one.

  3. Add the LcdMenu library to your project by adding the following line to your platformio.ini file:

    lib_deps =
        forntoh/LcdMenu@^3.0.0
  4. Save the changes to the platformio.ini file.

  5. Build and upload your project to your device.

Usage

To use the LcdMenu library in your project, follow these steps:

1. Include the LcdMenu library in your sketch

#include <LcdMenu.h>

You will need to add other includes for the types of menu items you wish to use, the available types are described in the next step.

2. Create the main menu, use the provided macro MAIN_MENU() e.g.

MAIN_MENU(
  ITEM_INPUT("Connect", resultCallback),
  ITEM_BASIC("Settings"),
  ITEM_COMMAND("Backlight", toggleBacklight),
  ITEM_TOGGLE("Toggle", "ON", "OFF", toggleStuff)
);

Replace the sample menu items with your own menu items. Here are the different types of menu items available:

Type Description Import
ITEM_BASIC a basic menu item with no functionality N/A
ITEM_COMMAND a menu item that executes a function when selected <ItemCommand.h>
ITEM_TOGGLE a menu item that toggles a value when selected <ItemToggle.h>
ITEM_INPUT a menu item that prompts the user to enter a value <ItemInput.h>
ITEM_SUBMENU a menu item that leads to a sub-menu when selected <ItemSubMenu.h>
ITEM_STRING_LIST a menu item that displays a value that is chosen form a list of strings <ItemList.h>

For each menu item, specify the menu item text, and any necessary parameters. For example, in ITEM_COMMAND("Backlight", toggleBacklight), "Backlight" is the menu item text and toggleBacklight is the function to be executed when the item is selected.

3. Once you have created your menu, initialize LcdMenu with the menu items in the setup()

menu.setupLcdWithMenu(0x27, mainMenu); //I2C
// or
menu.setupLcdWithMenu(rs, en, d0, d1, d2, d3, mainMenu); // Standard

4. In the loop() function, define how you want to navigate the menu

You can use any input method of your choice to perform actions on the menu

The most essential actions are:

  • menu.up() and menu.down() - Go up and down the menu
  • menu.left() and menu.right() - if the menu is in edit mode,
    • for ITEM_INPUT it moves along the characters of the value.
    • for ITEM_STRING_LIST it cycles through the items.
  • menu.enter() - if the active item is
    • ITEM_INPUT or ITEM_STRING_LIST it goes into edit mode, if you call it again while in edit mode, it executes the callback bound to the item and exits edit mode.
    • ITEM_COMAND or ITEM_TOGGLE it executes the bound callback
    • ITEM_SUBMENU it enters the sub-menu.
  • menu.back() - either exits edit mode or goes to back to a parent menu depending on the active item.

Full examples can be found here 👈

And that's it! You should now have a fully functional LCD menu system for your Arduino project


Have a question/doubt? Check the Discussions tab, maybe your question has already been answered 😉

More Repositories

1

2048

The classic 2️⃣0️⃣4️⃣8️⃣ game using Jetpack Compose
Kotlin
11
star
2

android-livedata-validation

DataBinding ViewModel form validation library for Android ♻
Kotlin
10
star
3

odx-tools

Tools for manipulating ODX vehicle data
TypeScript
5
star
4

smart_home

Smart home UI design in Flutter
Dart
3
star
5

mdcdoc

Generate markdown docs from comments in C and CPP files.
JavaScript
3
star
6

forntoh

2
star
7

noir-cam

TypeScript
2
star
8

UControl

Use a single mouse 🖱️ and keyboard ⌨️ across multiple PCs
Java
2
star
9

DTOfferWall

Digital Turbine Offer Wall Client App (Jetpack)
Kotlin
2
star
10

music_player

Dart
1
star
11

android-common

Kotlin
1
star
12

ViewStatusManager-Android

ViewStatus manager is a tool used to ease the process of adding and managing a ProgressView (feedback) when loading information to a view.
Java
1
star
13

BableSchool

Kotlin
1
star
14

intellij-platform-plugin-template

Kotlin
1
star
15

flutter_practice_01

Dart
1
star
16

EasyRecyclerView-Android

Java
1
star
17

flutter_practice_03

Dart
1
star
18

TMDB

TMDB Client for Android using Compose UI
Kotlin
1
star
19

MBOASSIKOLOPATH

School Orientation app for Cameroonians
Kotlin
1
star
20

ngcircle-ict

JavaScript
1
star
21

Checkers

Checkers is a multiplayer network enabled board game developed using the JavaFX library by Oracle. Two players can play the game either on the same machine (local) or on two different PC's on the same network. The concept is that, there is a host and a client, the host starts the game and the client connects to the host using a specific port defined by the host application. (The app has to be running on both PCs) Join me and play.
Java
1
star
22

UniC

Have you often found yourself trying to control two computers at once, and getting confused like which keyboard and which mouse goes with which? WTF!. UniC is here to solve the problem, you no longer need two keyboards or mice, with UniC, you can share your mouse and keyboard with all your PCs without getting confused, it even saves you money from buying mice and keyboards. Right now most of the features are not yet available, but they will be available soon. This version is based on JavaFX
Java
1
star