Added first steps for LiquidMenu system menu.

master
Holger Wirtz 6 years ago
parent 2150845e14
commit 36b8b6f9ee
  1. 7
      MicroMDAEPiano.ino
  2. 46
      UI.hpp

@ -230,9 +230,10 @@ void setup()
Serial.println(F("<setup end>"));
menu.next_screen();
menu.update();
menu_system.next_screen();
menu_system.update();
menu_system.switch_focus();
#if defined (DEBUG) && defined (SHOW_CPU_LOAD_MSEC)
show_cpu_and_mem_usage();
cpu_mem_millis = 0;

@ -29,18 +29,42 @@
extern LiquidCrystal_I2C lcd;
LiquidMenu menu(lcd);
const char text1[] PROGMEM = "MicroMDAEPiano";
const char text2[] PROGMEM = "(c)parasiTstudio";
//const char text1[] PROGMEM = "";
// Welcome screen
LiquidLine welcome_line1(1, 0, text1);
LiquidLine welcome_line2(0, 1, text2);
const char text00[] PROGMEM = "MicroMDAEPiano";
const char text01[] PROGMEM = "(c)parasiTstudio";
LiquidLine welcome_line1(1, 0, text00);
LiquidLine welcome_line2(0, 1, text01);
LiquidScreen welcome_screen(welcome_line1, welcome_line2);
// Main menu
const char text10[] PROGMEM = "Favorites ";
const char text11[] PROGMEM = "Sound ";
const char text12[] PROGMEM = "Store ";
const char text13[] PROGMEM = "Info ";
LiquidLine main_line1(0, 0, text10);
LiquidLine main_line2(0, 1, text11);
LiquidScreen main_screen(main_line1, main_line2);
LiquidMenu main_menu(lcd,welcome_screen,main_screen,1);
// Sound menu
const char text20[] PROGMEM = "Decay ";
const char text21[] PROGMEM = "Release ";
const char text22[] PROGMEM = "Hardness ";
const char text23[] PROGMEM = "Treble ";
LiquidLine sound_line1(0, 0, text20);
LiquidLine sound_line2(0, 1, text21);
LiquidLine sound_line3(0, 1, text22);
LiquidLine sound_line4(0, 1, text23);
LiquidScreen sound_screen(sound_line1, sound_line2, sound_line3, sound_line4);
LiquidMenu sound_menu(lcd,sound_screen);
// System menu
LiquidSystem menu_system(main_menu, sound_menu);
void callback_main_function() {
Serial.println(F("You called the main callback function."));
}
void menu_init(void)
{
@ -51,7 +75,9 @@ void menu_init(void)
lcd.backlight();
lcd.noAutoscroll();
menu.add_screen(welcome_screen);
menu.update();
main_line1.attach_function(1, callback_main_function);
menu_system.update();
}
#endif

Loading…
Cancel
Save