MenuManager contains the functions to manage menu items, there is a global instance of this class called menuMgr. Here we present the most commonly used features, check out the reference docs for more details. There are a lot of iteration helper functions that can be used to navigate through menu structures. These are described further down the page. The following two reference documentation pages extend on the information here: Menu iteration reference docs MenuManager reference docs EEPROM support in menus Enabling next and back functionality To enable next, back or both, you provide the pin onto which you’ve connected the button for this function.
An I2C LCD backpack based on the PCF8574 chip provides an easy way to get started with LiquidCrystalIO on most Arduino boards. It is usually in one of two configurations as listed below. This library works correctly with the display and even has a shorthand way of creating the LCD for this case. Connectivity combinations for i2c backpacks Pin Option1 Option2 0 RS EN 1 RW RW 2 EN RS 3 Backlight Backlight 4 D4 D4 5 D5 D5 6 D6 D6 7 D7 D7 Construction for Option 1 outside of any functions (global):
There are often cases when you’ll need to run a micro controller from a battery power source. Unlike when running from mains power, every milli-amp matters. In these cases IoAbstraction’s task manager is able to integrate easily with most low power libraries. Task manager works by repeatedly calling the runLoop() function within loop() or main, during each loop task manager evaluates if any tasks are yet ready to run, and if they are it runs them.
TcMenu supports a wide range of rendering devices, from HD44780 based units using our LiquidCrystal fork through to mono OLED’s and full colour TFT displays using the Adafruit_GFX library. In order to achieve such a wide range of displays the renderer describes things in terms of menu items, active positions, editors and dialogs. This allows each renderer to convert these concepts into something that works for its needs. You can also easily take over the display to draw your own screen at any time.
Using a matrix keyboard with TcMenu is straightforward, we use the IoAbstraction Keyboard Manager component to handle the keyboard, along with a custom listener for tcMenu that feeds the menu manager with appropriate events upon key presses. This library allows you to connect your keyboard either using Arduino pin, or any supported IoAbstraction such as the I2C PCF8574 or MCP23017. Setting up the menu sketch for a Matrix Keyboard Step 1 is to wire up your keyboard in accordance with the above linked keyboard manager page, I recommend at this point testing it through the packaged IoAbstraction example.
TcMenu has considerable out of the box remote connectivity on both Arduino and mbed. With support for Ethernet2 library, UipEthernet library, ESP8266 WiFi, ESP32 WiFi and Serial (including Bluetooth Serial) to name a few connectors. Please pay close attention to the following classes in the reference documentation as they are mentioned frequently here: BaseRemoteServerConnection in reference docs TcMenuRemoteService in reference docs. Please bear in mind that TcMenu is able to support a wide range of remote connectors.
IoAbstraction has full support for interrupts on most devices, meaning we can connect a Rotary Encoder to an Arduino using a standard PCF8574 IO expander chip. In order to do this we need the PCF8574 /INT line to be connected to an Arduino pin that supports interrupts (such as pins 2 or 3). Further, you can also have switches handle push button input without polling, by initialising for interrupt, especially useful with IO exapnders.
Worked example: Building a timer For this example we will create a menu that has two top level menu items; a counter which counts down from the selected value, and a Boolean switch that turns on or off the countdown. It will also have a submenu with one menu item to control the notification method. So lets draw this out conceptually below menu root +- countdown, integer values 0 to 1000 seconds +- enabled, boolean YES, NO.
You can connect up a device using just about any arrangement of pins or expander, at the end of the day any device supported by IoAbstraction, including MultiIo (pins and IoExpander mix) can be used here. Examples showing these use cases MCP23017 LiquidCrystal example Shift register 74HC595 LiquidCrystal Back to the main page
Matrix keyboards are arranged such that the keys are in a matrix of rows and columns. This means that instead of needing a spare input for each key, one INPUT for each column and one OUTPUT for each row is all that’s needed. In order to use the keyboard, we create a class of type MatrixKeyboardManager and configure it with an IoAbstractionRef, a KeyboardLayout that describes the keyboard attached (there are some standard ones already defined) and a listener that will be informed of changes.