Can you put a menu or sub-menu inside an If else statement or void function? #129
-
So in the machine I was going to create I have 3 buttons(up,down,enter), 2x16LCD, 2 float sensor. In order to run specific codes based on the current state of float sensor I used if-else statement like this: if (floatSwitch1State == HIGH && floatSwitch2State == LOW) { delay(100);
If there are other ways to create a menu that shows a sub-menu depends on the current state of something please kindly tell. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It's not possible to build a menu dynamically (on runtime) with this menu system, you can update already existing menus but can't create. However, your logic seems very simple, you can just update the text of the ITEM_COMMAND and like set a bool var to true which you can check in the callback function and decide the appropriate action to take. |
Beta Was this translation helpful? Give feedback.
It's not possible to build a menu dynamically (on runtime) with this menu system, you can update already existing menus but can't create.
However, your logic seems very simple, you can just update the text of the ITEM_COMMAND and like set a bool var to true which you can check in the callback function and decide the appropriate action to take.