Command & Toggle
This is a basic example, it will show you how to use callback functions in the LcdMenu library.
Callbacks can be used with menu items of type ItemCommand
, ItemInput
, ItemList
, ItemProgress
or ItemToggle
Includes
Declare the callback function
Add a callback to MenuItem
Define the callback function
When enter()
is invoked, the command (callback) bound to the item is invoked.
Constructor reference
key: display text of the item
textOn: display text when ON
textOff: display text when OFF
callback: reference to a callback function
Full code 👉 .../examples/Callbacks/Callbacks.ino
Last updated