Virtuabotixrtc.h Arduino: Library

// Define connections: CLK, DAT, RST // Change these pin numbers based on your wiring #define CLK 6 #define DAT 7 #define RST 8

Before diving into the software, it is essential to understand the hardware that the Virtuabotix library controls. The is a trickle-charge timekeeping chip containing a real-time clock/calendar and 31 bytes of static RAM. Key Features of the DS1302:

void loop() myRTC.updateTime(); // Update time from RTC virtuabotixrtc.h arduino library

void loop() myRTC.updateTime(); lcd.setCursor(0, 0); lcd.print("Time:"); lcd.print(myRTC.hour); lcd.print(":"); if (myRTC.minute < 10) lcd.print("0"); lcd.print(myRTC.minute); lcd.print(":"); if (myRTC.second < 10) lcd.print("0"); lcd.print(myRTC.second);

The library is not installed correctly. Fix: Reinstall via Library Manager or check that you have #include <virtuabotixRTC.h> at the top. // Define connections: CLK, DAT, RST // Change

// UNCOMMENT THE NEXT LINE TO SET TIME, THEN COMMENT IT BACK AND RE-UPLOAD // myRTC.setDS1302Time(00, 30, 14, 4, 25, 10, 2023);

Standard wiring for most examples using this library typically connects to the following digital pins on an Arduino Uno: Arduino Project Hub DS1302 Pin Arduino Pin (Typical) Library Parameter SCLK / CLK Basic Usage Example Fix: Reinstall via Library Manager or check that

This means the library is not installed in your Arduino IDE. Because it is a legacy public domain library, it is not always found in the official library manager. You must download the ZIP folder from a trusted repository like GitHub's ArduinoRTClibrary and click Sketch > Include Library > Add .ZIP Library in the IDE.

#include <virtuabotixRTC.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27, 16, 2); virtuabotixRTC myRTC(2, 3, 4);