-
Notifications
You must be signed in to change notification settings - Fork 22
now()
This function returns the current RTC date and time as a "DateTime Class" class. It is the only function that reads the RTC datetime value.
...
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
DateTime now = MCP7940.now(); // get the date and time from RTC
Serial.print("Year: "); Serial.println(now.year());
Serial.print("Month: "); Serial.println(now.month());
Serial.print("Day: "); Serial.println(now.day());
Serial.print("Hour: "); Serial.println(now.hour());
Serial.print("Minute: "); Serial.println(now.minute());
Serial.print("Second: "); Serial.println(now.second());
...
} // of setup
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