-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
155 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Basic menu item | ||
--------------- | ||
|
||
The basic menu item is a simple menu item that displays a text label on the screen. | ||
It does not have any special behavior other than being selectable by the user. | ||
It behaves like a placeholder and has no associated action or behavior. | ||
|
||
The basic menu item is useful for creating simple menu structures with static text labels. | ||
|
||
A basic menu item can be created using the following syntax: | ||
|
||
.. code-block:: cpp | ||
ITEM_BASIC("Item 1") | ||
This is how a basic menu item is rendered on a 16x2 LCD screen: | ||
|
||
.. image:: images/item-basic.png | ||
:alt: Basic menu item | ||
|
||
Find more information about the basic menu item in the :doc:`API reference </reference/api/MenuItem>`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
Command menu item | ||
----------------- | ||
|
||
The command menu item is a menu item that executes a function when selected by the user. | ||
It is useful for creating menu items that perform a specific action when selected. | ||
|
||
This can be used in various scenarios, such as: | ||
|
||
- Controlling a device or sensor (e.g., turning on a motor) | ||
- Changing a setting or configuration (e.g. saving a setting/value) | ||
- Triggering an event or action (e.g., sending a message) | ||
|
||
How to create a command menu item | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
A command menu item can be created using the following syntax: | ||
|
||
.. tab-set:: | ||
|
||
.. tab-item:: As a lambda function | ||
|
||
.. code-block:: cpp | ||
ITEM_COMMAND("Item 1", []() { | ||
// Function body | ||
}) | ||
.. tab-item:: As a function pointer | ||
|
||
.. code-block:: cpp | ||
// Function definition | ||
void myFunction() { | ||
// Function body | ||
} | ||
// Create a command menu item | ||
ITEM_COMMAND("Item 1", myFunction) | ||
Let's take a look at an example of a command menu item that simply prints a message to the serial monitor when selected: | ||
|
||
.. code-block:: cpp | ||
ITEM_COMMAND("Print Message", []() { | ||
Serial.println("Hello, world!"); | ||
}) | ||
When the "Print Message" menu item is selected, the message "Hello, world!" will be printed to the serial monitor. | ||
|
||
.. code-block:: console | ||
$ Hello, world! | ||
Find more information about the command menu item in the :doc:`API reference </reference/api/ItemCommand>`. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Deep Dive | ||
========= | ||
|
||
Let's dive deep into the details of the system. | ||
|
||
The first thing you need to know is that the system is built around the concept of a menu screen. | ||
A menu screen is a collection of menu items that are displayed on the screen. | ||
Each menu item can be selected and interacted with by the user. | ||
|
||
The system provides a number of built-in menu items that you can use to create your menu structure. | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
:caption: Here are some of the built-in menu items: | ||
|
||
basic | ||
command | ||
submenu | ||
toggle | ||
value | ||
list | ||
custom | ||
|
||
You can also create your own custom menu items by extending the base menu item class. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters