- char seconds_remaining[5];
- sprintf(seconds_remaining, "%d", (int)((game_time - n_millis_total) / 1000));
- for (int i = 0; i < 4; i++) {
- cdcacm_putchar(seconds_remaining[i]);
+ char time_remaining[6];
+ uint32_t seconds_remaining = (uint32_t)((game_time - n_millis_total) / 1000);
+ int minutes = (int)(seconds_remaining / 60);
+ int seconds = (int)(seconds_remaining % 60);
+ sprintf(time_remaining, "%02d:%02d", minutes, seconds);
+ for (int i = 0; i < 5; i++) {
+ cdcacm_putchar(time_remaining[i]);