Librarie pour ecran 128x32 de MyLab
Diff: menu.cpp
- Revision:
- 12:00bbd42614c7
- Parent:
- 11:c00a727f140f
- Child:
- 13:337e207baca2
diff -r c00a727f140f -r 00bbd42614c7 menu.cpp --- a/menu.cpp Tue Mar 29 18:26:15 2016 +0000 +++ b/menu.cpp Tue Mar 29 18:56:20 2016 +0000 @@ -10,7 +10,7 @@ - +extern MyLab periph; void printMenu(int menuItem) { lcd.cls(); @@ -41,28 +41,28 @@ } int setMenu() { + char pos[6]; + periph.JoyStick_Position(pos); - if (!joy_s) + if (strcmp(pos,"South") == 0) { joystickPos = "DOWN"; if (menuItem >= 0 && menuItem < 3) printMenu(++menuItem); } - else if (!joy_c){ + else if (strcmp(pos,"Center") == 0){ if (menuItem == 1) select_app = 1; else if(menuItem == 2) select_app = 2; joystickPos = "CLICK"; } - else if (!joy_n) + else if (strcmp(pos,"North") == 0) { joystickPos = "UP"; if (menuItem <= 3 && menuItem > 0) printMenu(--menuItem); } - else - joystickPos = "CENTRE"; return select_app; }