evo još jednog dodatka ako želite 24 H prikaz vremena na displeju
Pronađite u kodu (linija 6007)
Code:
updateTimeDate();
}
zamjenite stari dio iza ovog dijela sa ovim
Code:
void updateTimeDate()
{
RTC.now();
// draw date and time
myGLCD.setColor(240, 240, 255);
myGLCD.setFont(Sinclair_S);
if ((hour()!=prevRTC.tHour) || (minute()!=prevRTC.tMinute) || updateTime) printTime(hour(), minute(), 196, 2);
if ((day()!=prevRTC.tDay) || (month()!=prevRTC.tMonth) || (year()!=prevRTC.tYear) || updateTime) { //date
prevRTC.tDay = day();
prevRTC.tMonth = month();
printDate(56, 2);
}
}
void printTime(int thour, int tminute, int posx, int posy)
{
char tmpTime[8], charT[3];
tmpTime[0] = '\0';
if (thour >= 0 && thour <= 9) { //add 0
strcat(tmpTime, "0");
itoa(thour, charT, 10);
strcat(tmpTime, charT);
strcat(tmpTime, ":");
}
else{
itoa(thour, tmpTime, 10);
strcat(tmpTime, ":");
}
if (tminute>=0 && tminute<=9) { //add 0
strcat(tmpTime, "0");
itoa(tminute, charT, 10);
strcat(tmpTime, charT);
}
else {
itoa(tminute, charT, 10);
strcat(tmpTime, charT);
}
myGLCD.print(tmpTime, posx, posy); // Display time
}