Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 🎸 add elapsed time and total duration to screen #19

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions SpotifyDiyThing/cheapYellowLCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down