AceUtils
0.5.0
Useful Arduino utilties which are too small as separate libraries, but complex enough to be shared among multiple projects, and often have external dependencies to other libraries.
|
A class that helps navigate the hierarchical ModeGroup tree defined by the rootModeGroup
.
More...
#include <ModeNavigator.h>
Public Member Functions | |
ModeNavigator (ModeGroup const *rootModeGroup) | |
Constructor. More... | |
uint8_t | mode () const |
Return the current mode identifier. | |
void | setup () |
Activate the navigator by setting the mode to be the first mode in the ModeGroup hierarchy. More... | |
void | changeMode () |
Move to the next sibling mode and wrap to 0 if the end is reached. | |
void | changeGroup () |
Alternate between a root group and a child group. More... | |
A class that helps navigate the hierarchical ModeGroup tree defined by the rootModeGroup
.
Currently, this class supports only a 2-level ModeGroup tree, the rootGroup and the array of childGroups, because that's the navigation needs of my various clocks which use 2 buttons to expose various functionalities without using a menu system. I think a hierarchy with more than 2-levels would require a menu to help users avoid getting lost, so this class currently does not support that. Maybe in the future.
Definition at line 19 of file ModeNavigator.h.
|
inline |
Constructor.
Initialize the navigator using the root ModeGroup.
Definition at line 22 of file ModeNavigator.h.
|
inline |
Alternate between a root group and a child group.
This class currently supports only a 2-level hierarchy.
Definition at line 47 of file ModeNavigator.h.
|
inline |
Activate the navigator by setting the mode to be the first mode in the ModeGroup hierarchy.
It is no longer kModeUnknown.
Definition at line 33 of file ModeNavigator.h.