Hi Marcel,
Upon further inspection that exactly what is happening. My fix below was to modify the code line (true) and (false) statements. It took care of the problem. I also eliminated the! further up in the code per the thread recommendations. My modification is below.
I like many others am unable to access the touch features. I'll play around in the forum and see if I can't work that out too.
Thank you again for your help!
// draws the clock
void drawTime() {
char time_str[11];
time_t now = time(nullptr);
struct tm * timeinfo = localtime(&now);
gfx.setTextAlignment(TEXT_ALIGN_CENTER);
gfx.setFont(ArialRoundedMTBold_14);
gfx.setColor(MINI_WHITE);
String date = WDAY_NAMES[timeinfo->tm_wday] + " " + MONTH_NAMES[timeinfo->tm_mon] + " " + String(timeinfo->tm_mday) + " " + String(1900 + timeinfo->tm_year);
gfx.drawString(120, 6, date);
gfx.setFont(ArialRoundedMTBold_36);
if (false) {
int hour = (timeinfo->tm_hour + 11) % 12 + 1; // take care of noon and midnight
sprintf(time_str, "%2d:%02d:%02d\n", hour, timeinfo->tm_min, timeinfo->tm_sec);
} else {
sprintf(time_str, "%02d:%02d:%02d\n", timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec);
}
gfx.drawString(120, 20, time_str);
gfx.setTextAlignment(TEXT_ALIGN_LEFT);
gfx.setFont(ArialMT_Plain_10);
gfx.setColor(MINI_BLUE);
if (true) {
sprintf(time_str, "\n%s", timeinfo->tm_hour >= 12 ? "PM" : "AM");
gfx.drawString(195, 27, time_str);
}
}