#include <RTClib.h> // Define RTC_ DS1307 and DateTime
#include "my_lcd.h"
MyLCD lcd;
RTC_ DS1307 rtc;
void setup() {
Serial.begin(115200);
lcd.begin();
if(!rtc.(!rtc.begin()) { // Time is critial
Serial.println((F( "Error: RTC not found!"));
while (1); // Halt if RTC fails
}
}
void loop() {
struct tm timeinfo;
if (!getLocalTime(&timeinfo)) {
DateTime now = rtc.now();
char dtbuf[21]; //2025-07-05 00:00-00:00 on power up.
strftime(buffer,21, "%0y-%0m-%0d %I:%M:%S %p", &timeinfo);
lcd.datetime(dtbuf);
lcd.alarm(1, "Temp UL1:", "40.6", 0);
delay(5000);
lcd.alarm(2, "Curr UL2:", "60.0", "A");
delay(5000);
}LCD (20x4) (I2C)
DS1307 RTC