Library of Navigator of menu systems
Diff: Navigator.cpp
- Revision:
- 0:8209f74d51a0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Navigator.cpp Thu Feb 28 22:19:46 2013 +0000 @@ -0,0 +1,25 @@ +#include "Navigator.h" + +Navigator::Navigator(Menu &root, RPG &rpg, TextLCD *lcd) : activeMenu(root), rpg(rpg), lcd(lcd) {} + +void Navigator::printMenu() +{ + lcd->printf("%s\n", activeMenu.selections[0].selText); + lcd->printf("%s\n", activeMenu.selections[1].selText); +} + +void Navigator::poll() +{ + if((direction = rpg.dir())!=0){ //Get Dir + wait(0.2); + lcd->cls(); + lcd->printf(" direction:%d\n", direction); + } + + if (rpg.pb()){ + wait(0.2); + lcd->cls(); + lcd->printf(" button pressed\n"); + } + +} \ No newline at end of file