I cannot for the life of me get it to switch to 12hr mode, it seems to be stuck in 24hr.
I've also tried to use other librarie's example code with the same result, it refuses to switch to 12hr.
Here is the relevant code from my sketch:
Code: Select all
#include <RTClib.h> // required for RTC
#define TIME_24_HOUR false;
RTC_DS3231 rtc;
void setup() {
if (!rtc.begin()) {
Serial.println("Couldn't find clock!");
while (1)
;
}
rtc.adjust(DateTime(F(__DATE__), F(__TIME__))); //set time to compile timestamp
}
void displayUpdate() {
DateTime now = rtc.now();
char timeStr[] = "hh:mm";
char dateStr[] = "DDD, MMM DD YYYY";
u8g2.setFont(u8g2_font_crox3cb_mn);
u8g2.setCursor(30, 45);
u8g2.print(now.toString(timeStr));
u8g2.setFont(u8g2_font_5x7_mf);
u8g2.setCursor(20, 60);
u8g2.print(now.toString(dateStr));
u8g2.sendBuffer();
}