Skip to content

getMFP()

Arnd edited this page Dec 11, 2020 · 2 revisions

This function is used to get the MCP7940's MFP pin state as either on or off. The MFP is the multifunction pin which can be set or unset either via the setMFP() function if it is not being used as either a square wave output or for either of the two builtin alarms. If used as an alarm it will be low (false) when the alarm is triggered. Although the MCP7940 allows the alarm condition to be asserted as either high or low, the library uses high condition as the default, unasserted, condition and when an alarm is triggered the pin will be pull low.


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
 while (MCP7940.getMFP()) {
   Serial.println("Alarm pin not triggered.");
   ...
 } // of while the alarm hasn't triggered
...
Clone this wiki locally