Arduino Library Link - Virtuabotixrtc.h

The library is not installed correctly. Fix: Reinstall via Library Manager or check that you have #include <virtuabotixRTC.h> at the top.

Serial.print("Date (MM/DD/YYYY): "); Serial.println(myRTC.getDateStr()); // Returns "04/30/2026"

void loop() (currentHour > 6 && currentHour < 20) virtuabotixrtc.h arduino library

| DS1302 Module | Arduino Uno | | :--- | :--- | | VCC | 5V | | GND | GND | | CLK | Digital Pin 7 | | DAT | Digital Pin 6 | | RST | Digital Pin 5 |

Serial.println("RTC Time has been set!"); The library is not installed correctly

// Define the pins used to connect the RTC module const int rtcClockPin = 2; const int rtcDataPin = 3; const int rtcCsPin = 4;

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); Here is an example: Standard wiring for most

void loop() myRTC.updateTime(); int tempReading = analogRead(A0); float voltage = tempReading * (5.0 / 1023.0); float temperatureC = (voltage - 0.5) * 100;

To get the current date and time, you can use the getDateTime() method, which returns a DateTime object. Here is an example:

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