Virtuabotixrtc.h Arduino Library May 2026

// Set the time and date manually // Syntax: setDS1302Time(seconds, minutes, hours, dayOfMonth, month, dayOfWeek, year) // NOTE: dayOfWeek: Sunday=1, Monday=2 ... Saturday=7

#include <virtuabotixRTC.h> virtuabotixRTC myRTC(7, 6, 5); int alarmPin = 13; // Built-in LED bool alarmTriggered = false;

// Example: April 30, 2026, 14:30:00, Wednesday (dayOfWeek = 4) myRTC.setDS1302Time(00, 30, 14, 30, 4, 4, 26); virtuabotixrtc.h arduino library

// Check if we are within working hours (9 AM to 5 PM) if (myRTC.hours >= 9 && myRTC.hours < 17)

// 1. Raw integers (Best for logic) Serial.print("Raw Data: "); Serial.print(myRTC.hours); // 24-hour format Serial.print(":"); Serial.print(myRTC.minutes); Serial.print(":"); Serial.println(myRTC.seconds); // Set the time and date manually //

else // Outside working hours: do nothing (or deep sleep) Serial.println("Outside logging hours. Sleeping...");

// 2. Formatted Strings (Best for Serial Monitor) Serial.print("Time (HH:MM:SS): "); Serial.println(myRTC.getTimeStr()); // Returns "14:30:00" Sleeping

void setup() Serial.begin(9600);