Skip to content

TcMenu/tcMenu

Repository files navigation

tcMenu - A menu library and designer for Arduino and mbed with IoT capabilities

Java Test Linux nightly macOS nightly Windows nightly License: Apache 2.0

Build your menu now with web designer

A menu library and designer UI for Arduino and mbed that is modular enough to support different input methods, display modules and IoT / remote control methods. TcMenu is more than just an Arduino menu library, think of it as a framework for building IoT applications that includes the ability to render menus locally onto a display.

TurboQuickStart.mp4

Get started building your menu right away using Web based TcMenu Designer Turbo, it takes care of building the core menu code and putting any callback functions into your sketch file.

Think of the designer like a form designer in the desktop domain. Furthermore, It's non-destructive on the sketch file, so can be round tripped during development.

TcMenu organisation invests a lot of time and resources into making this open source product which is used by literally thousands of users. Releasing a UI, renting server space cost more than you'd think. Please consider at least making this project cost-neutral to me by using either option to sponsor the project.

Sponsor me on GitHub (this repository).

Buy Me A Coffee

In any fork, please ensure all text up to here is left unaltered.

Documentation

Questions, community forum and support

Community questions can be asked in the discussions section of this repo, or using the Arduino forum (but please tag me). We generally answer most community questions but the responses may not be timely. Before posting into the community make sure you've recreated the problem in a simple sketch, and please consider making at least a one time donation (see links further up):

  • Discussions section of this git repo (available from top menu of github page).
  • Arduino discussion forum where questions can be asked, please tag me using @davetcc.

Getting Started: TcMenu Designer Turbo (Web-Based)

The easiest and fastest way to build your first menu is using our web-based designer. It can generate nearly all existing menu, handle all existing plugins, and supports a new fluent mode where the output is much cleaner.

Note for All-In-One or Fluent API mode you need to use TcMenu Library as 4.5.x.

Quick Start for the impatient

Open the Web based TcMenu Designer Turbo and either drag an example EMF file into it, or start a new project. Once you got an open project, you'll see the menu tree structure on the left, and the details for each menu when selected on the right. Below the menu tree are buttons that manage items in the menu tree.

Once you've arranged your menu using the UI how you'd like it, go to the "Generate" tab at the top, choose appropriate hardware arrangements and hit generate. This will provide a zip with your new project.

Libraries required for tcMenu

TcMenu supports different boards and build tools. It is possible to use it directly with both platformIO and Arduino IDE. It should also work with most mbed tooling as the libraries compile on mbed.

The easiest way to get started is to install tcMenu library using library manager, all the dependencies are automatically installed. However, if you like to manually manage libraries, below are the links to their repos:

Embedded Libraries for Arduino and mbed

Additional libraries you may need depending on display

Licenses and usage

All components of tcMenu other than the Web Designer and the bitmap/font editor are licensed under Apache 2.0.

The tcMenu Web Designer and bitmap/font editor are licensed under Apache 2.0 with the Commons Clause. See [LICENCES.md]

But in summary, tcMenu continues to be fully open source under Apache 2.0. The new Web Designer and bitmap/font editor are now released under a protected licence. This keeps them free for makers, hobbyists, and internal company use, while requiring a commercial licence for redistribution, SaaS hosting, or embedding into paid products.

The goal is straightforward: keep tcMenu open and accessible, while ensuring the long‑term sustainability of the project and preventing commercial misuse of the Designer components.

Loading and saving menu items

tcMenu can also save menu item state to EEPROM storage. On AVR that will generally be internal EEPROM, on 32 bit boards generally an AT24 i2c EEPROM.

Input and display technologies

Here are a few examples of how the menu can look with version 2.0 of our menu library on Arduino, ESP, and mbed:

Arduino menu running on ESP32 with ILI9341 and touch screen

Arduino menu in dark mode running on ESP32 with ILI9341 and touch screen

Arduino menu on OLED running on ESP8266 with SH1106 and touch screen

Arduino menu on LCD running on AVR

Support for rotary encoders, digital/analog joysticks and touch buttons

We fully support rotary encoder based input with no need for any additional components in many cases. You can even connect your rotary encoder on a PCF8574, AW9523 or MCP23017. Further, we even support more than one encoder.

You can configure 3 or more buttons to work like a digital joystick using button based rotary encoder emulation (Up, Down and OK buttons with optional left and right) on either board pins, i2c expander, shift register. DfRobot analog input style buttons. Either DfRobot, or other analog ladder (configurable in code).

We also support the ESP32 touch pad interface, allowing up to 9 touch buttons to be used for menu input, they currently configure as per digital joystick.

Support for matrix keyboards

Matrix Keyboards of configurable size and key combination. Pre-canned options for 4x3 and 4x4 layouts. Most of the core functions work with a matrix keyboard.

Support for touch screens

From 2.0 onwards we'll support touch screen interfaces. We have built the support so that we can add many devices later, but to start with we will support resistive touch screens using 4 inputs, and the STM32 BSP provided touch screen interface.

Drawing to LiquidCrystal (i2c or direct)

We have a fork LiquidCrystal for 20x4 or 16x2 displays - can be either directly connected, over an i2c sheild (PCF8574, MCP23017, AW9523) or on a shift register. Our version of the library integrates better with task manager, yielding frequently.

Adafruit_GFX integration for many displays

Most libraries that are compatible with Adafruit_GFX will work with tcMenu, we've tested with the following TFT's ILI9341, ST7735 and also Nokia 5110 display. We even have a quick start option that helps you get started with this option.

For mbed RTOS 5/6 we have a custom Adafruit_GFX OLED driver https://github.com/TcMenu/Adafruit-GFX-mbed-fork that supports SSD1306, SH1106.

U8G2 integration for mono display

We can render onto most buffered displays using this library. Tested with OLED devices such as SSD1306 and SH1106. We can even provide a custom I2C byte function that yields to task manager frequently, making it work better with task manager, and correctly yield on ESP boards too.

TFT_eSPI and STM32 LTDC framebuffer integration

From 2.0 onwards we'll support TFT_eSPI and STM32 LTDC framebuffer based BSP functions to provide very high performance display rendering, we've tested with these two options on both ESP32 and STM32F429, the results were highly impressive.

No local input or display techonologies

Should your app not need any local display or input technologies, you can set up tcMenu so that it does not have local input or display, or you could have a single switch or LED on the device and manage it manually. In this case you'd use the below IoT support to manage the device remotely.

Remote IoT support on Ethernet, WiFi, Serial and Bluetooth/BLE

This menu library provides complete IoT remote control, presently over serial and ethernet. We've tested the serial support with both USB serial and Bluetooth, both work acceptably well. The full menu structure is sent over the wire and the Java API provides it as a tree that can be manipulated. There is also a defined protocol for other languages. In addition to this the menu can be programatically manipulated very easily on the device.

  • RS232 endpoint that supports full control of the menu items using a Java API - example app included.
  • Ethernet endpoint that supports either Ethernet2 library or UipEthernet.
  • Ethernet endpoint for mbed that supports the mbed socket implementation.
  • ESP8266 and ESP32 based WiFi both supported.

Ready built APIs and remote control UIs for tcMenu - embedCONTROL

TcMenu was built from day one for remote control and there are a few different offerings, we'll go through each one in turn, along with their intended use case:

Java embedCONTROL UI

This desktop UI can be easily built from the source here using the instructions provided, it is also packaged for desktop those who want to use it as it exists out of the box. This offering builds on top of JavaFX, it has an automated UI that builds automatically for any menu app with form support for more advanced cases.

Java / JVM API

There is a java API for accessing the menu remotely, source includes JavaDoc to help getting started. There is an example JavaFX UI built with it within the above Repo. Include the following into your maven build file:

    <dependency>
        <groupId>com.thecoderscorner.tcmenu</groupId>
        <artifactId>tcMenuJavaAPI</artifactId>
    </dependency>

C# API

The C# API is relatively complete and can do most of what the Java API can do, it is well tested and stable.

Repo: https://github.com/TcMenu/tcmenu-dotnet-sdk

Python API

There is now a Python API thanks to @vzahradnik - https://github.com/TcMenu/tcmenu-python-sdk

JavaScript and TypeScript

There is also an early version of a TypeScript API that can be used from any JavaScript environment. https://github.com/TcMenu/embedcontrolJS. In the future, we may better package this API to a package manager.

There is also a Webserver/HTML based app that you can deploy, but it only really works from a Raspberry PI with the embedded Java support. It is somewhat limited in what it offers. After careful evaluation we decided NOT to support ESP32 and STM32 for this app at the moment as it is too large for them.

Desktop Designer (Optional / Offline Use)

Note that web designer is now strongly recommended, and we've archived the desktop app. It is still packaged for installation on Windows, Linux, and MacOS for those who can't or prefer not to move over to the web designer.

Historic 4.4.x releases are directly available from the releases page, where there is a signed Windows version, notarized macOS version, and a package for Linux. There are also nightly builds in the repository – see the badges at the top.

Working with menus using the CLI

The most recent builds of TcMenu Designer include a CLI that has support for creating projects, adding and removing items, verifying and generating menus. Building and Generating menus from the CLI

Developer setup

See the developer guide

About

Menu library for Arduino, mbed and ESP with designer UI and remote control capabilities.

Topics

Resources

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors