parent
1605a486f0
commit
b94ee150fc
@ -1,86 +0,0 @@ |
|||||||
/*
|
|
||||||
MicroMDAEPiano |
|
||||||
|
|
||||||
MicroMDAEPiano is a port of the MDA-EPiano sound engine |
|
||||||
(https://sourceforge.net/projects/mda-vst/) for the Teensy-3.5/3.6 with audio shield.
|
|
||||||
|
|
||||||
(c)2019 H. Wirtz <wirtz@parasitstudio.de> |
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify |
|
||||||
it under the terms of the GNU General Public License as published by |
|
||||||
the Free Software Foundation; either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
|
||||||
along with this program; if not, write to the Free Software Foundation, |
|
||||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|
||||||
*/ |
|
||||||
|
|
||||||
#ifndef LIQUIDCRYSTALPLUS_I2C_H_INCLUDED |
|
||||||
#define LIQUIDCRYSTALPLUS_I2C_H_INCLUDED |
|
||||||
|
|
||||||
#include <LiquidCrystal_I2C.h> // https://www.arduinolibraries.info/libraries/liquid-crystal-i2-c |
|
||||||
|
|
||||||
#define STRING_BUF_SIZE 21 |
|
||||||
|
|
||||||
class LiquidCrystalPlus_I2C : public LiquidCrystal_I2C |
|
||||||
{ |
|
||||||
public: |
|
||||||
|
|
||||||
using LiquidCrystal_I2C::LiquidCrystal_I2C; |
|
||||||
|
|
||||||
void show(uint8_t y, uint8_t x, uint8_t fs, char *str) |
|
||||||
{ |
|
||||||
_show(y, x, fs, str, false, false); |
|
||||||
} |
|
||||||
|
|
||||||
void show(uint8_t y, uint8_t x, uint8_t fs, long num) |
|
||||||
{ |
|
||||||
char _buf10[STRING_BUF_SIZE]; |
|
||||||
|
|
||||||
_show(y, x, fs, itoa(num, _buf10, 10), true, true); |
|
||||||
} |
|
||||||
|
|
||||||
private: |
|
||||||
void _show(uint8_t pos_y, uint8_t pos_x, uint8_t field_size, char *str, bool justify_right, bool fill_zero) |
|
||||||
{ |
|
||||||
{ |
|
||||||
char tmp[STRING_BUF_SIZE]; |
|
||||||
char *s = tmp; |
|
||||||
uint8_t l = strlen(str); |
|
||||||
|
|
||||||
memset(tmp, 0, sizeof(tmp)); |
|
||||||
if (fill_zero == true) |
|
||||||
memset(tmp, '0', field_size); |
|
||||||
else |
|
||||||
memset(tmp, 0x20, field_size - 1); // blank
|
|
||||||
|
|
||||||
if (l > field_size) |
|
||||||
l = field_size; |
|
||||||
|
|
||||||
if (justify_right == true) |
|
||||||
s += field_size - l; |
|
||||||
|
|
||||||
strncpy(s, str, l); |
|
||||||
|
|
||||||
setCursor(pos_x, pos_y); |
|
||||||
print(tmp); |
|
||||||
|
|
||||||
#ifdef DEBUG |
|
||||||
Serial.print(pos_y, DEC); |
|
||||||
Serial.print(F("/")); |
|
||||||
Serial.print(pos_x, DEC); |
|
||||||
Serial.print(F(": [")); |
|
||||||
Serial.print(tmp); |
|
||||||
Serial.println(F("]")); |
|
||||||
#endif |
|
||||||
} |
|
||||||
} |
|
||||||
}; |
|
||||||
|
|
||||||
#endif |
|
@ -1,35 +0,0 @@ |
|||||||
/*
|
|
||||||
MicroMDAEPiano |
|
||||||
|
|
||||||
MicroMDAEPiano is a port of the MDA-EPiano sound engine |
|
||||||
(https://sourceforge.net/projects/mda-vst/) for the Teensy-3.5/3.6 with audio shield.
|
|
||||||
|
|
||||||
(c)2019 H. Wirtz <wirtz@parasitstudio.de> |
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify |
|
||||||
it under the terms of the GNU General Public License as published by |
|
||||||
the Free Software Foundation; either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
|
||||||
along with this program; if not, write to the Free Software Foundation, |
|
||||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|
||||||
*/ |
|
||||||
|
|
||||||
#include "config.h" |
|
||||||
#include "UI.h" |
|
||||||
|
|
||||||
/*
|
|
||||||
UI::UI() |
|
||||||
{ |
|
||||||
LiquidCrystalPlus_I2C lcd(LCD_I2C_ADDRESS, LCD_CHARS, LCD_LINES); |
|
||||||
enc[] = {Encoder4(ENC_L_PIN_A, ENC_L_PIN_B), Encoder4(ENC_R_PIN_A, ENC_R_PIN_B)}; |
|
||||||
enc_val[] = {INITIAL_ENC_L_VALUE, INITIAL_ENC_R_VALUE}; |
|
||||||
but[] = {Bounce(BUT_L_PIN, BUT_DEBOUNCE_MS), Bounce(BUT_R_PIN, BUT_DEBOUNCE_MS)}; |
|
||||||
} |
|
||||||
*/ |
|
@ -0,0 +1,57 @@ |
|||||||
|
/*
|
||||||
|
MicroMDAEPiano |
||||||
|
|
||||||
|
MicroMDAEPiano is a port of the MDA-EPiano sound engine |
||||||
|
(https://sourceforge.net/projects/mda-vst/) for the Teensy-3.5/3.6 with audio shield.
|
||||||
|
|
||||||
|
(c)2019 H. Wirtz <wirtz@parasitstudio.de> |
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify |
||||||
|
it under the terms of the GNU General Public License as published by |
||||||
|
the Free Software Foundation; either version 3 of the License, or |
||||||
|
(at your option) any later version. |
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, |
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
GNU General Public License for more details. |
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License |
||||||
|
along with this program; if not, write to the Free Software Foundation, |
||||||
|
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
||||||
|
*/ |
||||||
|
|
||||||
|
#include <LiquidCrystal_I2C.h> |
||||||
|
#include <LiquidMenu.h> |
||||||
|
|
||||||
|
#ifndef UI_HPP_INCLUDED |
||||||
|
#define UI_HPP_INCLUDED |
||||||
|
|
||||||
|
extern LiquidCrystal_I2C lcd; |
||||||
|
|
||||||
|
LiquidMenu menu(lcd); |
||||||
|
|
||||||
|
// Welcome screen
|
||||||
|
LiquidLine welcome_line1(1, 0, "MicroMDAEPiano"); |
||||||
|
LiquidLine welcome_line2(0, 1, "(c)parasiTstudio"); |
||||||
|
LiquidScreen welcome_screen(welcome_line1, welcome_line2); |
||||||
|
|
||||||
|
// Welcome screen
|
||||||
|
LiquidLine main_line1(0, 0, "Volume:"); |
||||||
|
LiquidLine main_line2(0, 1, "Voice"); |
||||||
|
LiquidScreen main_screen(main_line1, main_line2); |
||||||
|
|
||||||
|
void menu_init(void) |
||||||
|
{ |
||||||
|
// LCD display setup
|
||||||
|
lcd.init(); |
||||||
|
lcd.blink_off(); |
||||||
|
lcd.cursor_off(); |
||||||
|
lcd.backlight(); |
||||||
|
lcd.noAutoscroll(); |
||||||
|
|
||||||
|
menu.add_screen(welcome_screen); |
||||||
|
menu.add_screen(main_screen); |
||||||
|
menu.update(); |
||||||
|
} |
||||||
|
#endif |
Loading…
Reference in new issue