#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <RTClib.h>
// Set the LCD address to 0x27 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x27, 16, 2);
RTC_DS1307 rtc;
void setup()
{
// initialize the LCD
lcd.init();
// Turn on the backlight
lcd.backlight();
// Print a message to the LCD.
lcd.print("Hello, World!");
Serial.begin(115200);
Wire.begin();
rtc.begin();
}
void loop()
{
DateTime presentMoment = rtc.now();
int currentHour = presentMoment.hour();
int currentMinute = presentMoment.minute();
int currentSecond = presentMoment.second();
lcd.clear();
lcd.setCursor(0,0);
lcd.print(currentHour);
lcd.print(":");
lcd.print(currentMinute);
delay(1000);
}