Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TextLCD lcd(p15, p16, p17, p18, p19, p20); // rs, e, d4-d7
- RPG rpg(p21,p22,p23);
- SDFileSystem sd(p5, p6, p7, p8, "sd");
- using namespace std;
- int direction = 0;
- int cursor = 0;
- int main() {
- Menu menu1;
- menu1.add(Selection(NULL, 0, "Toggle LED1"));
- menu1.add(Selection(NULL, 1, "Toggle LED2"));
- menu1.add(Selection(NULL, 2, "Toggle LED3"));
- menu1.add(Selection(NULL, 3, "Toggle LED4"));
- Navigator navigator(menu1, rpg, lcd);
- navigator.printMenu();
- while(1){
- 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");
- }
- */
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement