Skip to content

setMFP()

Arnd edited this page Aug 6, 2017 · 2 revisions

This function is used to set the MCP7940's MFP pin. This is a multifunction pin that can be set to either output a square wave or to be set to either high/low when an alarm or other condition occurs. It can be set manually using this function when it is not being used as a square-wave output or in an alarm, in which case calls to this function are ignored.
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
 if (MCP7940.setMFP(false)) Serial.println("Successfully set MFP to false");
                       else Serial.println("Unable to set MFP pin.");
...
Clone this wiki locally