-
Notifications
You must be signed in to change notification settings - Fork 22
getAlarm()
This function is used to get the alarm settings and alarm type from one of the 2 builtin alarms of the MCP7940. The function returns a DateTime class value but the year will always be 2000 as the alarms don't store the year. The alarmType parameter is modified in the function call and returns values as below:
alarmType | Description |
---|---|
0 | Alarms off |
1 | Minutes match |
2 | Hours match |
3 | Day-of-Week matches |
4 | Date matches |
7 | Seconds, Minutes, Hours, Day-of-Week, Date and Month match |
...
MCP7940_Class MCP7940; // Create an instance of the MCP7940
...
void setup() {
Serial.begin(SERIAL_SPEED);
while (!MCP7940.begin()) { // Initialize RTC communications
Serial.println("Unable to find MCP7940. Checking again in 1 second.");
delay(1000);
} // of loop until device is located
uint8_t alarmType;
MCP7940.setAlarm(0,7,DateTime(2017,8,5,18,30,0)); // Alarm 0 triggers at 18:30:00 on 2017-08-05
DateTime alarmTime = MCP7940.getAlarm(0,alarmType);
Serial.print("Alarm 0 is set to type ");
Serial.print(alarmType);
Serial.print(" and the day is set to ");
Serial.println(alarmTime.day());
while (MCP7940.getMFP()); // loop until an alarm is triggered
...
Overview
Installation
Class Instantiation
DateTime Helper Class
TimeSpan Helper Class
begin()
deviceStatus()
deviceStart()
deviceStop()
now()
adjust()
calibrate()
calibrateOrAdjust()
getCalibrationTrim()
weekdayRead()
weekdayWrite()
readRAM()
writeRAM()
setMFP()
getMFP()
setAlarm()
getAlarm()
setAlarmState()
setAlarmPolarity()
getAlarmState()
clearAlarm()
getSQWSpeed()
setSQWSpeed()
setSQWState()
getPowerFail()
clearPowerFail()
getBattery()
setBattery()
getPowerDown()
getPowerUp()
readEUI() {00/01/02 only}
writEUI() {00/01/02 only}
-none-
SetAndCalibrate.ino
SetAlarms.ino
SquareWave.ino
TestBatteryBackup.ino
SimpleBatteryBackup.ino
AccessMemory.ino
RegressionTests.ino