RoundyFi
RoundyFi copied to clipboard
Digital clock in the middle of the round clock doesn't display minutes less than 10 correctly
E.g., "15:09" is shown as "15:9"
Add this and it will fix it:
String currentDate = String(monthDay)+ "-" + String(currentMonth) + "-" + String(currentYear);
String dateString = String(months[currentMonth - 1])+ " " + String(monthDay) + ", " + String(currentYear);
String minStr = "";
if(mm < 10) {
minStr = "0" + String(mm);
} else {
minStr = String(mm);
}
String currenttime = String(hh)+ ":" + minStr;
I also changed the display to be:
gfx->setCursor(100, 45);
gfx->setTextColor(ORANGE);
gfx->setTextSize(2);
gfx->println(currenttime);
gfx->setCursor(70, 100);
gfx->setTextColor(ORANGE);
gfx->setTextSize(2);
gfx->println(weekDay);
gfx->setCursor(45, 145);
gfx->println(dateString);
The Time is now more centered, and at the top, the Day string is just above center, and the data string is there.
HTH