Skip to content
Rui Azevedo edited this page Mar 4, 2017 · 14 revisions

###Current navigation level controller

nav.node()

return a (navNode) navigation level controller object, see navigation

###Active menu

nav.active()

resturns a menuNode object, the menuNode is a menu prompt that can receive keys/comands and has an optional associated action.

Can be a menu/sub-menu or any kind of field.

###Selected option

nav.node().sel

return the index of the selected option.

###Get option by index

nav.node()[idx]

return a prompt object representing the indexed option

##Get selected option

nav.selected()

return a prompt object representing the current selected option

##Start without menu

on setup do:

nav.idleOn();//this menu will start on idle state, press select to enter menu

suspended menu will resume when pressing select.

Also you can have any other suspension method because the menu is executed only when one of it's IO function is called (poll/doInput/doOutput). So if not calling them.. there is no menu.

##Prevent menu from exit

on setup function:

options->canExit=false;

Also you can provide an alternative config options setting, with that options already set to false.

##Reset current menu selection to top

nav.doNav(navCmd(idxCmd,0))

##Get a field value The menu does not store values (maybe some backups) instead it uses existing values from your code, so you already have access to field values. The menu system will change the variable value when needed.

example:

//outside setup or loop
int percent=0;

...

//on menu definition
FIELD(percent,"Power","%",...)

...

//when you want the value just use the variable
//in example, for printing
Serial.print("my percent value:");
Serial.println(percent);
Clone this wiki locally