diff --git a/SpotifyDiyThing/cheapYellowLCD.h b/SpotifyDiyThing/cheapYellowLCD.h index 673fcab..a8bc470 100644 --- a/SpotifyDiyThing/cheapYellowLCD.h +++ b/SpotifyDiyThing/cheapYellowLCD.h @@ -119,6 +119,18 @@ class CheapYellowDisplay : public SpotifyDisplay // Fill whats left black tft.fillRect(20 + barXWidth, progressStartY + 1, (screenWidth - 20) - (20 + barXWidth), 18, TFT_BLACK); + + // Display elapsed time in format 00:00 to left of the progress bar + char elapsedString[6]; + snprintf(elapsedString, sizeof(elapsedString), "%02d:%02d", (progress / 1000) / 60, (progress / 1000) % 60); + tft.setTextDatum(TL_DATUM); + tft.drawString(elapsedString, 5, progressStartY - 20, 2); + + // Display total time in format 00:00 to right of the progress bar + char totalString[6]; + snprintf(totalString, sizeof(totalString), "%02d:%02d", (duration / 1000) / 60, (duration / 1000) % 60); + tft.setTextDatum(TR_DATUM); + tft.drawString(totalString, screenWidth - 5, progressStartY - 20, 2); } void printCurrentlyPlayingToScreen(CurrentlyPlaying currentlyPlaying) diff --git a/platformio.ini b/platformio.ini index 4541900..5fbbe93 100644 --- a/platformio.ini +++ b/platformio.ini @@ -25,7 +25,7 @@ lib_deps = https://github.com/witnessmenow/Seeed_Arduino_NFC.git monitor_speed = 115200 monitor_filters = esp32_exception_decoder -upload_speed = 921600 +upload_speed = 115200 lib_ldf_mode = deep+ [common_cyd]