Virtuabotixrtch Arduino Library [ EXTENDED ]
– Works beautifully with DS1307 and DS3231. Not tested with newer PCF8523 or RV-3028.
DS1307, DS3231, PCF8563 (use their respective libraries like RTClib ).
The library provides an essential set of methods to configure, read, and write time data to the DS1302, which maintains accurate time independently of the main Arduino's power, thanks to a backup battery. virtuabotixrtch arduino library
module. While many RTC libraries favor the I2C protocol (common in DS1307 or DS3231 chips), this library is specifically designed for the DS1302’s unique 3-wire serial interface. Key Features Simple Interfacing:
: This is the main function to set the initial time on your RTC module. It writes the provided date and time to the DS1302 chip. The parameters are: – Works beautifully with DS1307 and DS3231
The DS1302 module solves this with two key features:
If your module has separate DS and SCLK pins (common on old DS1302 modules), do not use VirtuabotixRTC. That library is for I2C modules only (DS1307/3231). For DS1302, you need the DS1302 library. The library provides an essential set of methods
// Define the pins for the DS1302 // Arguments: RST(CE), DAT(I/O), CLK virtuabotixRTC myRTC(6, 7, 8);
myRTC.updateTime();
