Virtuabotixrtch Arduino Library <DIRECT>
void enableTrickleCharge(int diodeType, int resistorType);
void disableTrickleCharge();
Common values:
To use the library, you must first create an object. The constructor takes two arguments: the SDA pin and the SCL pin. For standard boards, we use A4 and A5 even though they are analog pins (they double as digital I2C).
#include <VirtuabotixRTC.h>
// Pin definition for Uno/Nano // (SDA, SCL) VirtuabotixRTC myRTC(A4, A5);virtuabotixrtch arduino library
Provide a lightweight, beginner-friendly interface to read/write time and date on a DS1302 without requiring complex bit-banging code. Common values:
You won't always find this specific library in the standard Library Manager search under "Virtuabotix." It is often distributed as a .zip file.
Cause: The library defines dayofweek where Monday = 1. If you expect Sunday = 1, you must offset: To use the library, you must first create an object
int sundayBased = (myRTC.dayofweek % 7) + 1;
VirtuabotixRTC(int cePin, int ioPin, int sclkPin);
On tiny chips without hardware I2C, you can use any two digital pins:
VirtuabotixRTC myRTC(0, 1); // Pin 0 = SDA, Pin 1 = SCL
Performance will be slower but functional.