#include "RTClib.h"
RTC_DS1307 rtc;
//-----------------------------------------------------------------------------
void setup () {
Serial.begin(115200);
if (! rtc.begin()) {
Serial.println("DS1307 not found");
while (1);
}
rtc.adjust(DateTime(2023, 5, 31, 12, 59, 40)); //(year), (month), (day), (hour), (minute), (second)
delay(100);
}
//-----------------------------------------------------------------------
void loop () {
DateTime now = rtc.now();
Serial.print(now.day());
Serial.print('/');
Serial.print(now.month(), DEC);
Serial.print('/');
Serial.println(now.year());
delay(2000);
}