Virtuabotixrtc.h Arduino Library [exclusive]

| Method | Purpose | |--------|---------| | setDS1302Time(byte second, byte minute, byte hour, byte dayOfWeek, byte dayOfMonth, byte month, byte year) | Writes all time registers (expects BCD values or standard ints, internally converted). | | updateTime() | Reads all time registers from the DS1302 into library variables. | | getSeconds() , getMinutes() , ... | Return cached time values (must call updateTime() first). | | setDOW(byte DOW) | Directly set day of week register. | | setTime(byte hour, byte minute, byte second) | Set time without date. | | setDate(byte month, byte day, byte year) | Set date without time. | | writeRAM(byte address, byte value) | Write to one of 31 bytes of battery-backed RAM (address 0-30). | | readRAM(byte address) | Read from that RAM location. |

The library simplifies the complex serial communication required by the DS1302 chip into a few intuitive commands. virtuabotixrtc.h arduino library

While the Arduino’s built-in millis() function is excellent for measuring short intervals, it resets every time the power is cycled. For calendar dates and long-term tracking, you need a dedicated Real-Time Clock (RTC) module. Among the most popular and affordable of these modules are the and DS1307 chips. | Return cached time values (must call updateTime() first)

Ensure the baud rate selected in your code (e.g., 9600 ) matches the baud rate set in the bottom right corner of your Arduino IDE Serial Monitor. | | setDate(byte month, byte day, byte year)

Here is the standard wiring diagram: