-
Notifications
You must be signed in to change notification settings - Fork 22
setAlarmPolarity()
Function is called to set the alarm pin polarity. It has one boolean parameter which determines the polarity as described in table 5-10 of the datasheet.
Polarity | # Alarms | Description |
---|---|---|
0 | One | MFP high when no alarm, low on alarm |
1 | One | MFP low when no alarm, high on alarm |
0 | Two | MFP high when no or one alarm, low when both alarms off |
1 | Two | MFP low when no alarm, high when either or both alarm triggered |
...
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.setAlarmPolarity(true); // pin goes high when alarm is triggered
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.setAlarmState(0,false); // Turn off the alarm
...
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