The
| DS1302 Module | Arduino Uno | | :--- | :--- | | VCC | 5V | | GND | GND | | CLK | Digital Pin 7 | | DAT | Digital Pin 6 | | RST | Digital Pin 5 | virtuabotixrtc.h arduino library
To get the time from the chip, you must call updateTime() . This fetches the current second, minute, hour, day, date, month, and year from the DS1302 and stores them in the object's public variables. The | DS1302 Module | Arduino Uno |
: virtuabotixRTC(uint8_t SCLK, uint8_t IO, uint8_t CE) Sets the pins for Serial Clock (SCLK), I/O Data (IO), and Chip Enable (CE/RST). : When paired with a backup battery (like
: When paired with a backup battery (like a CR2032), the RTC keeps time independently of the Arduino's power state.
Most users ignore the 31 bytes of NV RAM on the DS1302. However, VirtuabotixRTC.h exposes this through writeRAM() and readRAM() . This RAM is separate from the time registers and retains data as long as backup power is supplied.
Example (conceptual):