micanje konverzije sa C na F, samo komentirati liniju.
tempC = ((tempC*1.8)+32); //convert to F
// tempC = ((tempC*1.8)+32); //convert to F
dani i mjeseci po naški
// days and month character strings for displaing at the top of the screen
char *Day[] = {
"","Ned","Pon","Uto","Sri","Cet","Pet","Sub"};
char *Mon[] = {
"","Sijecanj","Veljaca","Ozujak","Travanj","Svibanj","Lipanj","Srpanj","Kolovoz","Rujan","Listopad","Studeni","Prosinac"};
// used for time
podešavanje datuma i vremena. Morao sam malo razmaknuti da sve stane u jednu liniju.
// draw date and time
myGLCD.setColor(240, 240, 255);
myGLCD.setFont(Sinclair_S);
if ((hour()!=prevRTC.tHour) || (minute()!=prevRTC.tMinute) || updateTime) printTime(hour(), minute(), 197, 2);
if ((day()!=prevRTC.tDay) || (month()!=prevRTC.tMonth) || (year()!=prevRTC.tYear) || updateTime) { //date
prevRTC.tDay = day();
prevRTC.tMonth = month();
printDate(40, 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
}
void printDate(int x, int y)
{
char chDate[25], tmpChar[5];
strcat(chDate, " ");
chDate[0] = '\0';
//strcat(chDate, Day[RTC.dow]);
strcat(chDate, Day[weekday()]);
strcat(chDate, ", ");
//strcat(chDate, Mon[RTC.month]);
strcat(chDate, Mon[month()]);
strcat(chDate, " ");
// itoa(RTC.day, tmpChar, 10);
itoa(day(), tmpChar, 10);
strcat(chDate, tmpChar);
// this line is for omitting year
strcat(chDate, " ");
//strcat(chDate, " ");
//itoa(RTC.year, tmpChar, 10);
//strcat(chDate, tmpChar);
//strcat(chDate, " ");
myGLCD.print(chDate, x, y); //Display date
}