Lineup Builder

Virtuabotixrtc.h Arduino Library · Simple & Recent

An RTC module like the DS1302 solves this by using an external crystal oscillator and a backup coin-cell battery. The virtuabotixRTC library provides the specific communication protocol needed to talk to this hardware easily.

// Create an instance of the VirtuabotixRTC class VirtuabotixRTC myRTC(rtcClockPin, rtcDataPin, rtcCsPin);

This library provides a straightforward interface to control the popular and cost-effective . Developed by Joseph Dattilo of Virtuabotix LLC, with a version as early as 0.4.5 released in 2011, it has become a go-to solution for hobbyists and educators looking to add real-time clocks to their Arduino-based devices. virtuabotixrtc.h arduino library

delay(1000); // Wait one second before the next reading

VirtuabotixRTC rtc(0x68); // DS1307 I2C address An RTC module like the DS1302 solves this

The DS1302 module is a trickle-charge timekeeping chip containing a real-time clock/calendar and 31 bytes of static RAM. Because standard Arduino libraries like Wire.h (I2C) do not natively communicate with the DS1302's unique 3-wire synchronous serial interface, the virtuabotixRTC library was created to bridge this gap. Key Features

void setup() Serial.begin(9600);

// SET THE TIME ON THE RTC (RUN ONCE) // Set to: 0 seconds, 30 minutes, 14 hours, Sunday (1), 7th day, April (4), 2024 // myRTC.setDS1302Time(0, 30, 14, 1, 7, 4, 2024); // Comment this line after you set the time.

While newer chips like the DS1307 or DS3231 utilize the I2C protocol, the DS1302 relies on a simple 3-wire serial interface. The virtuabotixRTC library simplifies communication with this hardware by eliminating the need for complex, low-level register manipulation. Key Benefits Developed by Joseph Dattilo of Virtuabotix LLC, with

Operates on less than 300nA at 2.0V, making it highly energy efficient.