It features intuitive functions for setting and retrieving time variables.
#include <virtuabotixRTC.h>
In the world of embedded electronics and DIY automation, keeping accurate time is a fundamental requirement. Whether you are building a data logger, an automated garden sprinkler, a programmable oven timer, or a complex home security system, your Arduino needs a way to know what time it is right now . virtuabotixrtc.h arduino library
: virtuabotixRTC(uint8_t SCLK, uint8_t IO, uint8_t CE) Sets the pins for Serial Clock (SCLK), I/O Data (IO), and Chip Enable (CE/RST).
Unlike modern I2C-based alternatives, the virtuabotixRTC.h library uses custom bit-banging communication. This approach allows users to connect an RTC module to any three digital pins on an Arduino board, bypassing dedicated I2C lines. Key Features of the Library It features intuitive functions for setting and retrieving
// Define connections: CLK, DAT, RST // Change these pin numbers based on your wiring #define CLK 6 #define DAT 7 #define RST 8
The library is lightweight and focused solely on DS1302 functionality, making it ideal for microcontrollers with limited memory. Hardware Wiring : virtuabotixRTC(uint8_t SCLK, uint8_t IO, uint8_t CE) Sets
void loop() myRTC.updateTime(); Serial.print(myRTC.hours); Serial.print(":"); Serial.print(myRTC.minutes); Serial.print(":"); Serial.println(myRTC.seconds); delay(1000);