Above: getting started video showing how to use our menu library with Arduino. Link to the Getting started with tcMenu Slides (from youtube video).
TcMenu is a complete menu solution for Arduino and mbed platforms that supports a wide range of input / display devices, and can be remotely controlled using embedCONTROL or using our Java Remote API on supported hardware. This page walks you through using tcMenu Designer to design and build an embedded application. We use a mix of screenshots from the Windows and Mac version, because although there are differences conceptually they are similar.
Your code will have access to the full power of IOAbstraction library and TaskManagerIO library. These two popular libraries make clean, event driven programming possible for embedded apps. TcMenu itself produces very clean code. Further, items can be stored to either onboard or i2c EEPROM.
Our Menu Designer software is available to download from the tcMenu releases page. It can design menus and generate code for a wide range of input, display and remote control options. Available as a signed installer for Windows, Notarized app for macOS, and as a Debian package for Linux.
When tcMenu Designer is not properly setup, a red banner appears in the properties area on the right, it’s best to set up the sketches folder in Edit -> General Settings before doing anything else. Without this we can’t show which examples and sketch are available.
On the main page we see several main areas, the main menu provides options to load and save menus, generate code and get help. You can add, remove and move around menu items from the MenuItem toolbar, when you do so you’ll see the structure change in the tree to the left.
Lastly, when root is selected, you can edit the project level properties. From here you can set the unique ID for the project. You can also set the board type we are aiming for (we support AVR, MKR, SAMD, ESP8266≤ ESP32, and mbed RTOS), the application name that will appear in the title area of the menu and is also sent to any remote controllers, and optionally a description.
Now choose an example menu design for a board that you already have (or the nearest one), there are examples for Uno/Mega, MKR/SAMD, ESP8266 and ESP32. The two simplest examples are the AnalogDfRobot and SimpleU8g2, these are very easy starting points.
On the Windows store version click the open button in the toolbar, on the Mac or Linux version select the examples from the File menu.
You should now see the following in the UI:
Now press on the plus button in the menu item toolbar (below the menu tree on the left). The following will appear:
You do not change the ID unless you explicitly want to manage them yourself, it is automatically generated and unique.
Choose the type of item you want to add and press create. In this case we create a regular numeric editor.
When we select an item in the menu structure tree, its properties become editable on the right hand side. We can change the name, EEPROM storage location (usually by pressing Auto to get the next location), and any properties that are specific to that kind of item.
You can optionally create a callback function that will be notified of any change immediately. However, you can check the state of the menu item at any time using the getter function (for example
getCurrentValue() for Analog and Enum items). In addition, you can change the state of a menu item at any time using the setter methods available on the MenuItem’s. For example on Analog item the method is
Before generating a menu, it’s a good idea to check that none of the EEPROM ranges or ID values overlap. To do this go to the
Generator -> Check ID & ROM range item from the main menu / toolbar. You’ll see something similar to the following dialog. Note that there should be no red entries in the EEPROM layout, this signifies that there is an overlap.
On the right is a representation of the EEPROM memory layout, Each entry shows the start position and number of bytes needed. If the item is in green, it does not overlap with another value. However, any item in red signifies a memory clash. Once done, close the dialog.
Now, we are ready to generate the code, from the main menu select
Code -> Generate Code to bring up the following dialog.
On this screen we choose how we are going to interact with the menu, in terms of input, output and remote control. To change the plugin press on the plugin image representation selection. A new dialog appears with suitable choices for the selected board. When any option needs additional parameters, they appear to the right of the plugin information, generally speaking you must ensure that the plugin is properly configured before choosing to generate. Below is a list of the most popular choices along with a link to more information about how to configure them.
At this point you now have code in the directory that you generated to. You’ll see several files:
main.cpp- this is the main file with setup and loop methods.
_menu.h- these contain the menu structures and renderer.
.hfiles - these wire up the displays, input and remote technologies.