-
Notifications
You must be signed in to change notification settings - Fork 22
TestBatteryBackup.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. The Battery pin should be connect to the power supply. Once the program is started it displays the time and a power failure is simulated by disconnecting the MCP7940's main power pin. The program detects that there is a power failure (since the I2C communications stop working) and when power to the MCP7940 is restored it will read the power failure and power restore datetimes and display them.
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