#include <Arduino.h>
#include <uRTCLib.h>
#include <LiquidCrystal_I2C.h>
// uRTCLib rtc;
uRTCLib rtc(0x68);
LiquidCrystal_I2C lcd(0x27,16,2);
char t[32];
void setup() {
Serial.begin(9600);
delay(3000); // wait for console opening
URTCLIB_WIRE.begin();
// Comment out below line once you set the date & time.
// Following line sets the RTC with an explicit date & time
// for example to set January 13 2022 at 12:56 you would call:
rtc.set(0, 56, 12, 5, 13, 1, 22);
// rtc.set(second, minute, hour, dayOfWeek, dayOfMonth, month, year)
// set day of week (1=Sunday, 7=Saturday)
lcd.init();
lcd.clear();
lcd.backlight();
}
void loop() {
rtc.refresh();
sprintf(t, "%02d:%02d:%02d", rtc.hour(), rtc.minute(), rtc.second());
Serial.println(t);
lcd.setCursor(0,0);
lcd.print(t);
delay(1000);
}