Rtc_Pcf8563 RTC Library for Arduino Author: Joe Robertson Contact: email@example.com
1.0.1 2013-1-3: Merged below 1.1 with Arduino 1.0 modifications to Wire. 1.1 has no version() method, while 1.0.1 does. 1.1 is considered a fork.
1.1 2012-03-02: Square wave support, bug fixing and more alarm methods
Rtc_Pcf8563 RTC is a library for the Arduino.
This library will control all aspects of the PCF8563 Real Time Clock chip. This chip uses an external crystal and caps and has 1 Interrupt output. Output may also be configured for wave signal. Alarms can be set to trigger the interrupt.
The PCF8563 is battery backed.
Current version: Attach:Rtc_Pcf8563_1.0.1.zip
Put the rtc_Pcf8563 folder in "hardware\libraries\".
In the Arduino IDE, create a new sketch (or open one) and
select from the menubar "Sketch->Import Library->Rtc_Pcf8563".
Once the library is imported, an "#include <Rtc_Pcf8563.h>" line will appear at the top of your sketch.
Remember to check your I2C addresses. There are set here, in the header file. And remember the games that Wire.h plays too!
To initialize the clock, in the setup() function do the following:
See the source for all methods.
Zero out all values and disable all alarms.
Set both status bytes to zero.
Get date vals to local vars. Then use these calls to get specific values or use one of the formatDate/Time calls.
Get time vars + 2 status bytes to local vars.
Set alarm vals. Since 0(zero) is a valid input, use val=99 as 'ignore me' value in the alarm.
Clear the alarm flag and interrupt.
Get an output string, these call getTime/getDate for latest vals. Format Time has 2 style, HM (hh:mm), and HMS (hh:mm:ss).
Date supports 3 styles as listed in the wikipedia page about world date/time. These are World, Asia, and US.
|Last Modified:||January 03, 2013, at 12:21 PM|