Skip to content

clearAlarm()

Arnd edited this page Jul 23, 2017 · 1 revision

This function is used to clear onne of the 2 builtin alarms of the MCP7940. If the condition which triggered the alarm is still true when the alarm is cleared then this function will leave the condition asserted.


Example:

...
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
 MCP7940.setAlarm(0,7,DateTime(2017,8,5,18,30,0)); // Alarm 0 triggers at 18:30:00 on 2017-08-05
 while (MCP7940.getMFP()); // loop until an alarm is triggered
 MCP7940.clearAlarm(0); // clear the alarm
...
Clone this wiki locally