Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: menu/Menu.cpp
- Revision:
- 16:7c612029d9c9
- Parent:
- 14:66a1965318cb
- Child:
- 19:33c77517cb88
diff -r 01a69bdb85e9 -r 7c612029d9c9 menu/Menu.cpp
--- a/menu/Menu.cpp Tue May 19 11:10:23 2020 +0000
+++ b/menu/Menu.cpp Tue May 19 13:49:30 2020 +0000
@@ -36,10 +36,10 @@
_y = 18;
}
-int Menu::display(N5110 &lcd, Gamepad &pad)
+void Menu::display(N5110 &lcd, Gamepad &pad)
{
- while ( pad.A_pressed() == false) {
+ while ( pad.A_held() == false) {
lcd.clear();
lcd.setContrast( pad.read_pot1());
@@ -54,7 +54,7 @@
}
wait(0.2);
- return option;
+ //return option;
}
void Menu::draw(N5110 &lcd)
@@ -108,7 +108,7 @@
void Menu::instructions(N5110 &lcd, Gamepad &pad)
{
- while ( pad.B_pressed() == false) {
+ while ( pad.B_held() == false) {
lcd.clear();
lcd.printString(" Instructions ",0,0);
@@ -121,3 +121,8 @@
}
wait(0.1);
}
+
+int Menu::getmode()
+{
+ return option;
+}