virtuobabotixRTC myRTC(7, 6, 5);
To understand the library, one must first understand the hardware it drives. The DS1302 is a trickle-charge timekeeping chip manufactured by Maxim Integrated (now Analog Devices). Key features include: virtuabotixrtc.h arduino library
In conjunction with a CR2032 coin cell battery, it ensures the RTC maintains time even when the Arduino is powered off. virtuobabotixRTC myRTC(7, 6, 5); To understand the library,
Uses only three digital pins (SCLK, I/O, and CE/RST) for communication. To understand the library
Note: You can change pins 5,6,7 in the software later.
void loop() DateTime dt = rtc.getDateTime(); Serial.print("Date: "); Serial.print(dt.date); Serial.print("/"); Serial.print(dt.month); Serial.print("/"); Serial.print(dt.year); Serial.print(" Time: "); Serial.print(dt.hour); Serial.print(":"); Serial.print(dt.minute); Serial.print(":"); Serial.println(dt.second); delay(1000);