-
Notifications
You must be signed in to change notification settings - Fork 22
SimpleBatteryBackup.ino
Sample Arduino sketch to demonstrate setting and using the two alarms on the MCP7940. For a detailed breadboard setup description see the SetAndCalibrate.ino page.
This sketch will only work correctly when using a MCP7940N. This example assumes that the Arduino and the MCP7940N are on the same power supply and that a separate battery-backup supply is going to the vBat and negative pins. When power fails to the Arduino and it reboots, the state of the MCP7940N is checked and if it detects a power failure it displays the relevant information and continues. Otherwise, if no power failure is detected, the program sets the MC7940N time to the compile date/time and continues.
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