Code for autonomous ground vehicle, Data Bus, 3rd place winner in 2012 Sparkfun AVC.

Dependencies:   Watchdog mbed Schedule SimpleFilter LSM303DLM PinDetect DebounceIn Servo

Embed: (wiki syntax)

« Back to documentation index

Menu Class Reference

Menu Class Reference

Simple menu interface model. More...

#include <Menu.h>

Public Member Functions

 Menu ()
 Create a new menu model.
void add (char *name, FunctionPtr f)
 add a new menu item
void next (void)
 select the next menu item as the current item
void prev (void)
 select the previous menu item as the current item
void select (void)
 run the function associated with the current item
char * getItemName (void)
 return the text for the current item
char * getItemName (int i)
 return text for a specified item
void printAll (void)
 print all the menu items

Detailed Description

Simple menu interface model.

Definition at line 8 of file Menu.h.


Constructor & Destructor Documentation

Menu (  )

Create a new menu model.

Definition at line 5 of file Menu.cpp.


Member Function Documentation

void add ( char *  name,
FunctionPtr  f 
)

add a new menu item

Definition at line 10 of file Menu.cpp.

char * getItemName ( void   )

return the text for the current item

Definition at line 48 of file Menu.cpp.

char * getItemName ( int  i )

return text for a specified item

Definition at line 42 of file Menu.cpp.

void next ( void   )

select the next menu item as the current item

Definition at line 21 of file Menu.cpp.

void prev ( void   )

select the previous menu item as the current item

Definition at line 29 of file Menu.cpp.

void printAll ( void   )

print all the menu items

Definition at line 53 of file Menu.cpp.

void select ( void   )

run the function associated with the current item

Definition at line 37 of file Menu.cpp.