This library is included in the Arc32 core. This core can be installed through the Arduino IDEs , where the package is named "Intel Curie Boards".
This library allows an Arduino/Genuino 101 control and use the internal RTC (Real Time Clock). A real-time clock is a clock that keeps track of the current time and that can be used in order to program actions at a certain time. Most RTCs use a crystal oscillator whose frequency is 32.768 kHz (same frequency used in quartz clocks and watches). Namely this the frequency equal to 2^15 cycles per second and so is a convenient rate to use with simple binary counter circuits. Furthermore the RTC can continue to operate in any sleep mode, so it can be used to wake up the device from sleep modes in a programmed way. Every time the board is powered, the RTC is reset and starts from a standard date. To keep the time and the RTC running it is necessary to keep the board powered.
To use this library
1#include <CurieTime.h>
now()
Returns the number of seconds since Jan 1 1970.
1unsigned long now = now()
The number of seconds since Jan 1 1970.
year()
Set or read the RTC year value.
1year(unsigned long year)2
3unsigned long year = year();
year: the year value to be set.
The current year value.
month()
Set or read the RTC month value.
1month(unsigned long month)2
3unsigned long month = month();
month: the month value to be set.
The current month value.
day()
Set or read the RTC day value.
1day(unsigned long day)2
3unsigned long day = day();
day: the day value to be set.
The current day value.
hour()
Set or read the RTC hour value.
1hour(unsigned long hour)2
3unsigned long hour = hour();
hour: the hour value to be set.
The current hour value.
minute()
Set or read the RTC minute value.
1minute(unsigned long minute)2
3unsigned long minute = minute();
minute: the minute value to be set.
The current minute value.
second()
Set or read the RTC second value.
1second(unsigned long second)2
3unsigned long second = second();
second: the second value to be set.
The current second value.
setTime()
Set hour, minute, second, day, month and year of the RTC
1void setTime(int hour, int minute, int second, int day, int month, int year)2
3void setTime(unsigned long t)
hour: the hour value to be set.
minute: the minute value to be set.
second: the second value to be set.
day: the day value to be set.
month: the month value to be set.
year: the year value to be set.
t: the current number of seconds since Jan 1 1970