diff --git a/Software/Gravity/Gravity.ino b/Software/Gravity/Gravity.ino index c891f79..f0c2642 100644 --- a/Software/Gravity/Gravity.ino +++ b/Software/Gravity/Gravity.ino @@ -6,16 +6,17 @@ #include #include -//const char version[5] = "1.1.1"; -String version = "1.1.1"; +#define VERSION "V:1.1.1" -#define SCREEN_ADDRESS 0x3C +byte memCode = 'D'; //Change to different letter if you changed the data structure #define PPQN 24 #define PULSE_LENGTH 12 //ms (with 12 ms you can't get higher than 208bpm) #define MAXBPM 200 //250 at 24ppqn with 5ms pulse will be 50/50 square wave #define MINBPM 20 +#define SCREEN_ADDRESS 0x3C + // Rev 2+ Config #define ENC_BTN_PIN 14 #define ENC_D1_PIN 17 @@ -99,7 +100,6 @@ byte currentStep = 0; byte stepNumSelected = 0; bool *patternToEdit; -byte memCode = 'C'; //Change to different letter if you changed the data structure unsigned int channelPulseCount[6]; unsigned int channelPulsesPerCycle[6]; @@ -191,8 +191,11 @@ const PROGMEM uint8_t stkL[569] U8G2_FONT_SECTION("stk-l") = "\210\14\21RC\206\241\63h\222(I\203\346\220\15\31E\204\14!\42\303F\20;h\341\0x\24\312" "\336\302 CGH\240\61E\312\14\222)\6Y\64\0\0\0\0\4\377\377\0"; +String version; void setup() { + version = F(VERSION); + NeoSerial.begin(31250); NeoSerial.attachInterrupt(receiveMIDI); diff --git a/Software/Gravity/UI.ino b/Software/Gravity/UI.ino index 4eecbfc..fd4f9e0 100644 --- a/Software/Gravity/UI.ino +++ b/Software/Gravity/UI.ino @@ -149,7 +149,7 @@ void updateScreen() { } else if (i == 1 && channels[displayTab - 1].mode == 2) { valueStr = F("SEQ"); } else if (i == 2 && channels[displayTab - 1].mode == 0) { //SubDiv and offset - valueStr = String(channels[displayTab - 1].offset) + "/"; + valueStr = String(channels[displayTab - 1].offset) + F("/"); int PulsesPerStep; if (subDivs[channels[displayTab - 1].subDiv] < 0) { PulsesPerStep = PPQN / subDivs[channels[displayTab - 1].subDiv] * -1 ; @@ -158,9 +158,11 @@ void updateScreen() { } valueStr = valueStr + String(PulsesPerStep); //(playingModes[i] * PPQN) - 1 //String(channelPulsesPerCycle[displayTab-1]+1) } else if (i == 2 && channels[displayTab - 1].mode == 1 && subDivs[channels[displayTab - 1].subDiv] > 0) { - valueStr = "/" + String(subDivs[channels[displayTab - 1].subDiv]); + valueStr = F("/"); + valueStr = valueStr + String(subDivs[channels[displayTab - 1].subDiv]); } else if (i == 2 && channels[displayTab - 1].mode == 1 && subDivs[channels[displayTab - 1].subDiv] < 0) { - valueStr = "x" + String(abs(subDivs[channels[displayTab - 1].subDiv])); + valueStr = F("x"); + valueStr = valueStr + String(abs(subDivs[channels[displayTab - 1].subDiv])); } else if (i == 3 && channels[displayTab - 1].CV1Target == 0 && channels[displayTab - 1].CV2Target == 0) { //MOD valueStr = F("OFF"); } else if (i == 3 && channels[displayTab - 1].CV1Target != 0 && channels[displayTab - 1].CV2Target == 0) { @@ -202,17 +204,20 @@ void updateScreen() { if (channels[displayTab - 1].mode == 0) { if (subDivs[channels[displayTab - 1].subDiv] > 0) { - valueStr = "/" + String(subDivs[channels[displayTab - 1].subDiv]); + valueStr = F("/"); } else { - valueStr = "x" + String(abs(subDivs[channels[displayTab - 1].subDiv])); + valueStr = F("x"); } + valueStr = valueStr + String(abs(subDivs[channels[displayTab - 1].subDiv])); } else if (channels[displayTab - 1].mode == 1) { valueStr = String(channels[displayTab - 1].random) + "0%"; } else if (channels[displayTab - 1].mode == 2) { if (channels[displayTab - 1].seqPattern < 8) { - valueStr = "A" + String(channels[displayTab - 1].seqPattern + 1); + valueStr = F("A"); + valueStr = valueStr + String(channels[displayTab - 1].seqPattern + 1); } else { - valueStr = "B" + String(channels[displayTab - 1].seqPattern - 7); + valueStr = F("B"); + valueStr = valueStr + String(channels[displayTab - 1].seqPattern - 7); } } u8g2.setFont(stkL); @@ -267,9 +272,11 @@ void updateScreen() { u8g2.setFont(velvetscreen); byte pattern = channels[displayTab - 1].seqPattern; if (pattern < 8) { - valueStr = "PATTERN A" + String(pattern + 1); + valueStr = F("PATTERN A"); + valueStr = valueStr + String(pattern + 1); } else { - valueStr = "PATTERN B" + String(pattern - 7); + valueStr = F("PATTERN B"); + valueStr = valueStr + String(pattern - 7); } u8g2.drawButtonUTF8(64, 5, U8G2_BTN_BW1|U8G2_BTN_HCENTER, 128, 0, 2, valueStr.c_str() ); for (byte i = 0; i < 8; i++) { @@ -304,22 +311,23 @@ void updateScreen() { else if (displayScreen == 2) { valueStr = F("SETTINGS"); u8g2.drawStr(8, 5, valueStr.c_str() ); - u8g2.drawStr(102, 5, version.c_str() ); + u8g2.drawStr(122 - (u8g2.getStrWidth(version.c_str())), 5, version.c_str() ); u8g2.drawHLine(0, 8, 128); lastMenuItem = 3; byte width = 112; for (byte i = 0; i <= lastMenuItem; i++) { switch(i) { case 0: - valueStr = F("CALIBRATE CV"); + valueStr = F("CALIBRATE CV INS"); break; case 1: valueStr = F("ROTATE SCREEN"); break; case 2: valueStr = F("REVERSE ENCODER"); + break; case 3: - valueStr = F("FULL RESET"); + valueStr = F("FACTORY RESET"); break; }; if (menuItem == i) {