Initializes the internal RTC. begin() needs to be called before any other RTC library methods.
rtc.begin()
none
Set the RTC hours value.
rtc.setHours(byte hours)
- hours: the hours value to be set.
Set the RTC minutes value.
rtc.setMinutes(byte minutes)
- minutes: the minutes value to be set.
Set the RTC seconds value.
rtc.setSeconds(byte seconds)
seconds: the seconds value to be set.
Set the RTC hours, minutes and seconds.
rtc.setTime(byte hours, byte minutes, byte seconds)
-
hours: the hours value to be set.
-
minutes: the minutes value to be set.
-
seconds: the seconds value to be set.
Set the RTC year.
rtc.setYear(byte year)
- year: the year value to be set.
Set the RTC month.
rtc.setMonth(uint8_t month)
- month: the month value to be set.
Set the RTC day.
rtc.setDay(byte day)
- day: the day value to be set.
Set the RTC day, month and year.
rtc.setDate(byte day, byte month, byte year)
-
day: the day value to be set.
-
month: the month value to be set.
-
year: the year value to be set.
Get the RTC hours value.
rtc.getHours()
the hours value.
Get the RTC minutes value.
rtc.getMinutes()
the minutes value.
Get the RTC seconds value.
rtc.getSeconds()
the seconds value.
Get the RTC Year value.
rtc.getYear()
the year value.
Get the RTC month value.
rtc.getMonth()
the month value.
Get the RTC day value.
rTC.getDay()
the day value.
Set the RTC Alarm hours value.
rtc.setAlarmHours(uint8_t hours)
- hours: the hours value to be set.
Set the RTC Alarm minutes value.
rtc.setAlarmMinutes(byte minutes)
- minutes: the minutes value to be set.
Set the RTC Alarm seconds value.
rtc.setAlarmSeconds(byte seconds)
- seconds: the seconds value to be set.
Set the RTC Alarm hours, minutes and seconds.
rtc.setAlarmTime(byte hours, byte minutes, byte seconds)
-
hours: the hours value to be set.
-
minutes: the minutes value to be set.
-
seconds: the seconds value to be set.
Set the RTC Alarm year.
rtc.setAlarmYear(byte year)
- year: the year value to be set.
Set the RTC Alarm month.
rtc.setAlarmMonth(byte month)
- month: the month value to be set.
Set the RTC Alarm day.
rtc.setAlarmDay(uint8_t day)
- day: the day value to be set.
Set the RTC Alarm day, month and year.
rtc.setAlarmDate(byte day, byte month, byte year)
-
day: the day value to be set.
-
month: the month value to be set.
-
year: the year value to be set.
Enable the RTC alarm to be triggered on a chosen match type
rtc.enableAlarm(rtc.AlarmMatch)
-
AlarmMatch: the chosen match type that can be chosen between:
- MATCH_SS: generate an alarm on seconds match;
- MATCH_MMSS: generate an alarm on minutes and seconds match;
- MATCH_HHMMSS: generate an alarm on hours, minutes and seconds match;
- MATCH_DHHMMSS: generate an alarm on day, hours, minutes and seconds match;
- MATCH_MMDDHHMMSS: generate an alarm on month, day, hours, minutes and seconds match;
- MATCH_YYMMDDHHMMSS: generate an alarm on year, month, day, hours, minutes and seconds match;
Disable the RTC alarm triggering.
rtc.disableAlarm()
none
Attach an interrupt action on alarm match.
rtc.attachInterrupt(voidFuncPtr callback)
- callback: The name of the function to be called on alarm match
Detach interrupt action on alarm match.
rtc.detachInterrupt()
none
Send the board in standby mode.
rtc.standbyMode()
None
Set the RTC frequency correction value. A positive value reduces the frequency, a negative value will increase the frequency.
rtc.setFrequencyCorrection(int8_t correction)
- correction: the number of counts to be increased or decreasd periodically by the RTC frequency correction module.