Virtuabotixrtc.h Arduino Library [updated]
Supports easy formatting of time/date for display, such as on an LCD or Serial Monitor. Typical Usage Example // Pins: SCLK, I/O, CE (RST) virtuabotixRTC myRTC( setup() { Serial.begin(
from the RTC chip and stores it in library variables. Example Code Implementation chrisfryer78/ArduinoRTClibrary - GitHub virtuabotixrtc.h arduino library
| 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. | Supports easy formatting of time/date for display, such
// Format: seconds, minutes, hours, day of week, day of month, month, year // Example: Setting time to Oct 25, 2023, Wednesday, 14:30:00 // Day of week: 1=Sunday, 2=Monday, ... 7=Saturday | | updateTime() | Reads all time registers
After uploading the code for the first time to set the time, comment out setDS1302Time()
The virtuabotixRTC.h library is a widely-used tool for interfacing Arduino boards with Real-Time Clock (RTC) modules, specifically the chip. This library simplifies the process of reading and setting time, allowing projects like digital clocks, data loggers, and automated systems to maintain accurate time even when power is lost. Key Features and Functionality


