Virtuabotixrtch Arduino Library < 2025-2027 >

: Carefully follow the manual installation steps outlined earlier. Ensure that the library's folder (e.g., virtuabotixRTC ) is placed directly inside your Arduino's libraries folder, and that this folder contains the virtuabotixRTC.h and virtuabotixRTC.cpp files.

#include <RtcDS1302.h> RtcDS1302<ThreeWire> Rtc(ioPin, sclkPin, cePin);

"Alright," Eli whispered, "Let’s tell you when you are." He uploaded a script to set the time : myRTC.setDS1302Time(00, 59, 23, 6, 10, 1, 2026); . virtuabotixrtch arduino library

Serial.print("Time: "); Serial.print(myRTC.hour); Serial.print(":"); Serial.print(myRTC.minute); Serial.print(":"); Serial.println(myRTC.second);

delay(1000); // wait one second before the next update : Carefully follow the manual installation steps outlined

You can choose any digital pins you like, but pins 6, 7, and 8 are a common convention used in many tutorials, including the one from Virtuabotix itself. Once the module is wired, you can proceed to the software setup.

void setup() Serial.begin(9600);

void loop() DateTime now = rtc.now(); Serial.print(now.year()); Serial.print("-"); Serial.print(now.month()); Serial.print("-"); Serial.print(now.day()); Serial.print(" "); Serial.print(now.hour()); Serial.print(":"); Serial.print(now.minute()); Serial.print(":"); Serial.println(now.second()); delay(1000);

You might notice that your RTC module always shows a default date/time (like 2000/01/01) when it powers up, instead of the time you set. Serial