Fixing not working buttons.

dev
Holger Wirtz 6 years ago
parent 72680fe369
commit a88e4ef95c
  1. 3
      MicroMDAEPiano.ino
  2. 20
      UI.hpp

@ -119,6 +119,9 @@ void setup()
{ {
//while (!Serial) ; // wait for Arduino Serial Monitor //while (!Serial) ; // wait for Arduino Serial Monitor
pinMode(BUT_L_PIN, INPUT_PULLUP);
pinMode(BUT_R_PIN, INPUT_PULLUP);
menu_init(); menu_init();
lcd.clear(); lcd.clear();

@ -36,6 +36,8 @@ extern Bounce but[2];
// Global vars // Global vars
uint8_t main_menu_selector = 0; uint8_t main_menu_selector = 0;
enum { BUT_L, BUT_R };
// Main menu // Main menu
const char text10[] PROGMEM = "Favorites "; const char text10[] PROGMEM = "Favorites ";
const char text11[] PROGMEM = "Sound "; const char text11[] PROGMEM = "Sound ";
@ -60,8 +62,14 @@ LiquidLine sound_line4(0, 1, text23);
LiquidScreen sound_screen(sound_line1, sound_line2, sound_line3, sound_line4); LiquidScreen sound_screen(sound_line1, sound_line2, sound_line3, sound_line4);
LiquidMenu sound_menu(lcd, sound_screen); LiquidMenu sound_menu(lcd, sound_screen);
// Info menu
const char text40[] PROGMEM = "INFO ";
LiquidLine info_line1(0, 0, text40);
LiquidScreen info_screen(info_line1);
LiquidMenu info_menu(lcd, info_screen);
// System menu // System menu
LiquidSystem menu_system(main_menu, sound_menu); LiquidSystem menu_system(main_menu, sound_menu, info_menu);
void callback_favorites_function() { void callback_favorites_function() {
Serial.println(F("callback_favorites_function")); Serial.println(F("callback_favorites_function"));
@ -122,11 +130,13 @@ void handle_ui(void)
switch (i) switch (i)
{ {
case 1: case BUT_R: // SELECT
if (but[i].risingEdge() || but[i].fallingEdge()) if (but[i].fallingEdge())
{ {
Serial.println(F("B0")); #ifdef DEBUG
main_menu.switch_focus(); Serial.println(F("SELECT-R"));
#endif
menu_system.next_screen();
} }
break; break;
} }

Loading…
Cancel
Save