#include <VirtuabotixRTC.h>

: Uses a three-wire interface (CLK, DAT, RST) to communicate with the Arduino.

void loop() myRTC.updateTime(); if (myRTC.minutes == 0) // Every hour at :00 Serial.print(myRTC.hours); Serial.print(":"); Serial.print(myRTC.minutes); Serial.print(" - Temperature: 22.3 C"); delay(60000); // Avoid multiple logs

Here are the most important functions you'll use with this library:

Unlike your PC or smartphone, the standard Arduino (Uno, Mega, Nano) does not have a built-in battery-backed clock. As soon as you unplug the USB cable, its internal counter resets to zero. This is where Real-Time Clock (RTC) modules come in.