From dcb4f2f6e5b6cbce66d7fefa9b4cb6476fbf4ce3 Mon Sep 17 00:00:00 2001 From: Noah Axon Date: Tue, 16 Jan 2024 19:05:30 -0600 Subject: [PATCH] Fix QR code, add battery debug serial messages for cardputer --- m5stick-nemo.ino | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/m5stick-nemo.ino b/m5stick-nemo.ino index d7a82e0..e8e226b 100644 --- a/m5stick-nemo.ino +++ b/m5stick-nemo.ino @@ -2,10 +2,10 @@ // github.com/n0xa | IG: @4x0nn // -=-=-=-=-=-=- Uncomment the platform you're building for -=-=-=-=-=-=- -#define STICK_C_PLUS +//#define STICK_C_PLUS //#define STICK_C_PLUS2 //#define STICK_C -//#define CARDPUTER +#define CARDPUTER // -=-=- Uncommenting more than one at a time will result in errors -=-=- String buildver="2.3.3"; @@ -627,6 +627,7 @@ int rotation = 1; DISP.println("%"); DISP.println(TXT_EXIT); } + void battery_setup() { // rstOverride = false; pinMode(VBAT_PIN, INPUT); @@ -649,6 +650,7 @@ int rotation = 1; if (battery != oldbattery){ Serial.println("Battery level:"); Serial.println(battery); + Serial.printf("Raw: %d\n", analogRead(VBAT_PIN)); battery_drawmenu(battery); } if (check_select_press()) { @@ -1663,13 +1665,19 @@ void qrmenu_loop() { delay(250); } if (check_select_press()) { - isSwitching = true; - current_proc = 1; - }else if ( activeQR == false ) { - activeQR = true; - DISP.fillScreen(WHITE); - DISP.qrcode(qrcodes[cursor].url, 0, 0, 80, 5); - DISP.qrcode(qrcodes[cursor].url, (DISP.width() - DISP.height()) / 2, 0, DISP.height(), 5); + if (qrcodes[cursor].url.length() < 1){ + current_proc = 1; + isSwitching = true; + }else if ( activeQR == false ) { + activeQR = true; + DISP.fillScreen(WHITE); + DISP.qrcode(qrcodes[cursor].url, (DISP.width() - DISP.height()) / 2, 0, DISP.height(), 5); + delay(500); + } else { + isSwitching = true; + activeQR = false; + delay(250); + } } }