Submenu

This example will show you how to get started with submenus

You have the possibility to attach as many sub-menus as your microcontroller can handle.

Code example

Includes

// other includes ...
#include <ItemSubMenu.h>
#include <LcdMenu.h> // Always comes after every item type import

Declare your menus

extern MenuItem* settingsMenu[];

You do not need to define the mainMenu, it is already defined for you in the MAIN_MENU macro.

Create the main menu

// Define the main menu
MAIN_MENU(
    ITEM_BASIC("Start service"),
    ITEM_BASIC("Connect to WiFi"),
    ITEM_SUBMENU("Settings", ),
    ITEM_BASIC("Blink SOS"),
    ITEM_BASIC("Blink random")
);

Create the submenu

/**
 * Create the submenu and precise its parent
 */
SUB_MENU(, ,
    ITEM_BASIC("Backlight"),
    ITEM_BASIC("Contrast")
);

Go to .../examples/SubMenu/SubMenu.ino

Last updated