Fixing not working buttons.

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

@ -119,14 +119,17 @@ 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();
lcd.setCursor(1,0); lcd.setCursor(1, 0);
lcd.print(F("MicroMDAEpiano")); lcd.print(F("MicroMDAEpiano"));
lcd.setCursor(0,1); lcd.setCursor(0, 1);
lcd.print(F("(c)parasiTstudio")); lcd.print(F("(c)parasiTstudio"));
Serial.begin(SERIAL_SPEED); Serial.begin(SERIAL_SPEED);
delay(500); delay(500);
@ -233,7 +236,7 @@ void setup()
menu_system.update(); menu_system.update();
menu_system.switch_focus(); menu_system.switch_focus();
#if defined (DEBUG) && defined (SHOW_CPU_LOAD_MSEC) #if defined (DEBUG) && defined (SHOW_CPU_LOAD_MSEC)
show_cpu_and_mem_usage(); show_cpu_and_mem_usage();
cpu_mem_millis = 0; cpu_mem_millis = 0;
@ -454,8 +457,8 @@ void set_volume(float v, float p)
#endif #endif
// http://files.csound-tutorial.net/floss_manual/Release03/Cs_FM_03_ScrapBook/b-panning-and-spatialization.html // http://files.csound-tutorial.net/floss_manual/Release03/Cs_FM_03_ScrapBook/b-panning-and-spatialization.html
mixer_r.gain(0,sinf(p * PI / 2)); mixer_r.gain(0, sinf(p * PI / 2));
mixer_l.gain(0,cosf(p * PI / 2)); mixer_l.gain(0, cosf(p * PI / 2));
} }
/****************************************************************************** /******************************************************************************

@ -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