Virtuabotixrtc.h Arduino Library -

#include // Creation of the Real Time Clock Object (CLK, DAT, RST) virtuabotixRTC myRTC(6, 7, 8); void setup() Serial.begin(9600); // Set time only on the first run: sec, min, hr, dow, day, month, year myRTC.setDS1302Time(00, 30, 15, 4, 16, 4, 2026); void loop() myRTC.updateTime(); // Pull latest data from the chip Serial.print("Current Date / Time: "); Serial.print(myRTC.dayofmonth); Serial.print("/"); Serial.print(myRTC.month); Serial.print("/"); Serial.print(myRTC.year); Serial.print(" "); Serial.print(myRTC.hours); Serial.print(":"); Serial.println(myRTC.minutes); delay(1000); Use code with caution. Copied to clipboard Installation and Availability

lcd.clear(); lcd.setCursor(0, 0); lcd.print("Initializing..."); virtuabotixrtc.h arduino library

Because the virtuabotixRTC library is a community-developed resource, it may not always appear in the default Arduino IDE Library Manager. Follow these manual steps to install it: #include // Creation of the Real Time Clock

Manages seconds, minutes, hours, day of the week, date of the month, month, and year. Automatic leap-year compensation valid up to the year 2100. Automatic leap-year compensation valid up to the year 2100

To install a library manually:

This occurs if you leave the setDS1302Time() command active in your code. Once the time is initially saved to the module's battery-backed memory, that line should be deleted or commented out.