Talking to the RTC

The RTC is an i2c device, which means it uses 2 wires to to communicate. These two wires are used to set the time and retrieve it. On the Arduino UNO, these pins are also wired to the Analog 4 and 5 pins. This is a bit annoying since of course we want to have up to 6 analog inputs to read data and now we've lost two.

For the RTC library, we'll be using a fork of JeeLab's excellent RTC library, which is available on GitHub. You can do that by visiting the github repo and manually downloading or, easier, just click this button to download the zip

Install Adafruit_RTCLib library

For the RTC library, we'll be using a fork of JeeLab's excellent RTC library.

To begin reading and writing to the RTC, you will need to install the Adafruit_RTClib library (code on our github repository). It is available from the Arduino library manager so we recommend using that.

From the IDE open up the library manager...

And type in RTClib to locate the library. 

Look for the Adafruit RTClib (there may be others!)

Click Install

We also have a great tutorial on Arduino library installation at:
http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use

Once done, restart the IDE

This guide was first published on Jan 29, 2013. It was last updated on Mar 08, 2024.

This page (Arduino Library) was last updated on Mar 08, 2024.

Text editor powered by tinymce.