: Manually setting seconds, minutes, hours, day of the week, day of the month, month, and year. Time Updating
#include <VirtuabotixRTC.h>
The VirtuabotixRTCH library provides a range of functions to interact with the RTCH module. Here are some of the most commonly used functions: virtuabotixrtch arduino library
The VirtuabotixRTC library is an Arduino library (written in C++) that abstracts away the low-level I2C register manipulation required to talk to DS1307 and DS3231 real-time clocks. Unlike the more common RTClib by Adafruit (which requires additional dependencies like Wire.h and TimeLib.h ), the Virtuabotix library is self-contained and minimalistic.
On tiny chips without hardware I2C, you can use any two digital pins: : Manually setting seconds, minutes, hours, day of
: Providing direct access to individual time variables (e.g., myRTC.hours myRTC.seconds ) for display or logic. Basic Wiring Setup
Even with a simple library, you might run into a few common issues. Here's how to solve them. Unlike the more common RTClib by Adafruit (which
: Manages the synchronous serial communication (RST, I/O, and SCLK) required by the DS1302 without needing deep knowledge of the IC's protocol.
lcd.setCursor(0, 1); lcd.print(myRTC.month); lcd.print("/"); lcd.print(myRTC.dayofmonth); lcd.print("/20"); lcd.print(myRTC.year);
module. While older and often replaced by newer I2C-based alternatives like the DS3231, it remains a popular choice for beginners using basic DS1302 hardware due to its simple syntax. Core Functionality