Virtuabotixrtc.h Arduino Library -
Serial.println("Time set on RTC.");
| DS1302 Pin | Arduino Pin | |------------|--------------| | VCC | 5V | | GND | GND | | CLK | 6 | | DAT | 7 | | RST | 8 | virtuabotixrtc.h arduino library
void loop() // Update the internal variables from the RTC chip myRTC.updateTime(); Serial
int currentHour = myRTC.hours;
// Set the time (year, month, day, hour, minute, second, day-of-week) // Sunday = 1, Monday = 2, ..., Saturday = 7 // Example: March 15, 2025, 14:30:00, Saturday = 7 myRTC.setDS1302Time(25, 3, 15, 14, 30, 00, 7); Serial.println("Time set on RTC.")