Fixing not working buttons.

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

@ -119,12 +119,15 @@ void setup()
{
//while (!Serial) ; // wait for Arduino Serial Monitor
pinMode(BUT_L_PIN, INPUT_PULLUP);
pinMode(BUT_R_PIN, INPUT_PULLUP);
menu_init();
lcd.clear();
lcd.setCursor(1,0);
lcd.setCursor(1, 0);
lcd.print(F("MicroMDAEpiano"));
lcd.setCursor(0,1);
lcd.setCursor(0, 1);
lcd.print(F("(c)parasiTstudio"));
Serial.begin(SERIAL_SPEED);
@ -454,8 +457,8 @@ void set_volume(float v, float p)
#endif
// 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_l.gain(0,cosf(p * PI / 2));
mixer_r.gain(0, sinf(p * PI / 2));
mixer_l.gain(0, cosf(p * PI / 2));
}
/******************************************************************************

@ -36,6 +36,8 @@ extern Bounce but[2];
// Global vars
uint8_t main_menu_selector = 0;
enum { BUT_L, BUT_R };
// Main menu
const char text10[] PROGMEM = "Favorites ";
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);
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
LiquidSystem menu_system(main_menu, sound_menu);
LiquidSystem menu_system(main_menu, sound_menu, info_menu);
void callback_favorites_function() {
Serial.println(F("callback_favorites_function"));
@ -122,11 +130,13 @@ void handle_ui(void)
switch (i)
{
case 1:
if (but[i].risingEdge() || but[i].fallingEdge())
case BUT_R: // SELECT
if (but[i].fallingEdge())
{
Serial.println(F("B0"));
main_menu.switch_focus();
#ifdef DEBUG
Serial.println(F("SELECT-R"));
#endif
menu_system.next_screen();
}
break;
}

Loading…
Cancel
Save