#include <DS1307RTC.h>
DS1307RTC rtc;
uint8_t sec, minit, myhour, myday, mymonth;
uint16_t myyear;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
rtc.set(0, 0, 8, 19, 03, 2024);
rtc.stop();
rtc.start();
}
void loop() {
// put your main code here, to run repeatedly:
delay(1000); // this speeds up the simulation
rtc.get(&sec, &minit, &myhour, &myday, &mymonth, &myyear);
Serial.print("\nTime: "); Serial.print(myhour, DEC); Serial.print(":"); Serial.print(minit, DEC); Serial.print(":"); Serial.print(sec, DEC);
Serial.print("\nDate: "); Serial.print(myday, DEC); Serial.print("."); Serial.print(mymonth, DEC); Serial.print("."); Serial.print(myyear, DEC);
}