ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el18ac

Dependencies:   mbed

Revision:
4:17d5b53b8815
Parent:
2:7fa08670b1fc
Child:
6:a2c72def99f9
--- a/Menu/Menu.cpp	Tue May 26 16:52:17 2020 +0000
+++ b/Menu/Menu.cpp	Tue May 26 17:13:20 2020 +0000
@@ -91,24 +91,20 @@
 
 void Menu::menu_screen()
 {
-    while(_pad.A_held() == false) {                           //unitl A is pressed, the code
+    wait(0.1);
+    _lcd.drawSprite(WIDTH/2-26,25,5,7,(int*)selector);
+    _lcd.refresh();
+    while(_pad.A_held() == false) {                             //unitl A is pressed, the code
         arrow();                                                //stays on the meun,
-        _lcd.refresh();                                          //executing only the code of the arrow
+        _lcd.refresh();                                         //executing only the code of the arrow
         wait(1/6);
     }
 
-    /*if (_lcd.getPixel(20,27)) {                                  //if A is pressed and the arrow
-        movement();                                             //is corresponding to PLAY,
-        draw();                                                 //the code executes game, movement, draw functions
-        _lcd.refresh();
-        wait(1/6);
-    }*/
     if (_lcd.getPixel(20,35)) {                                 //if A is pressed and the arrow
         help();                                                 //is corresponding to HELP,
         _lcd.refresh();                                         //the code executes help function
         wait(1/6);
     }
-    _lcd.refresh();
 }
 
 void Menu::arrow()
@@ -117,7 +113,6 @@
     _lcd.printString("MENU",WIDTH/2-15,1);
     _lcd.printString("Play",WIDTH/2-13,3);
     _lcd.printString("Help",WIDTH/2-13,4);
-    //_lcd.drawSprite(WIDTH/2-26,25,5,7,(int*)selector);
     _lcd.refresh();
     wait(1/6);