Virtuabotixrtch Arduino Library -

Search for "virtuabotixRTC" on GitHub and download the repository as a ZIP file. Open Arduino IDE: Launch your Arduino software.

Once the time is set, you upload the final code to read the time continuously.

– Works beautifully with DS1307 and DS3231. Not tested with newer PCF8523 or RV-3028. virtuabotixrtch arduino library

Ensure your Baud rate is set to 9600 to match Serial.begin(9600) .

This library allows an Arduino to communicate with the DS1302 chip using a 3-wire interface (Serial Clock, I/O Data, and Chip Enable). Its primary features include: Time Setting Search for "virtuabotixRTC" on GitHub and download the

void setup() Serial.begin(9600);

To use the library, you must connect the DS1302 RTC module to your Arduino. The DS1302 uses a 3-wire serial interface (distinct from I2C or standard SPI). DS1302 Pin Description Arduino Pin (Example) Power Supply (2.0V - 5.5V) 5V or 3.3V GND CLK Serial Clock DAT Serial Data RST (or CE) Reset / Chip Enable – Works beautifully with DS1307 and DS3231

void setup() // Set time only once (year, month, day, hour, minute, second) myRTC.setDS1307Time(30, 24, 12, 6, 15, 4, 23); // 4:23:15, 6/24/2030

The following complete Arduino sketch demonstrates how to set the RTC for the first time and then continuously print the current time to the Serial Monitor.

If you are using a DS1307 or DS3231 module, require advanced features like alarms or high accuracy, or prefer a library that is actively maintained and has comprehensive support, RTClib is the better choice.

// Print the time in a readable format Serial.print("Current Date/Time: "); Serial.print(myRTC.dayofmonth); Serial.print("/"); Serial.print(myRTC.month); Serial.print("/"); Serial.print(myRTC.year); Serial.print(" ");