-
Notifications
You must be signed in to change notification settings - Fork 22
TimeSpanClass
The TimeSpan class (as well as the related DateTime class) have been taken from Adafruit's RTClib which in turn was forked from Jeelab's RTClib. The TimeSpan class encompasses the definitions needed to store and manipulate a specific length of time without having a specific date/time.
Several methods can be used to instantiate this class depending upon what format the span is defined:
TimeSpan span1(seconds); // Number of seconds
TimeSpan span2(12,18,05,0) // 12 days, 18 hours, 5 minutes and 0 seconds
TimeSpan span3(span2); // Instantiate from another TimeSpan instance
The stored values can be manipulated by:
span1 = span1 + span2; // Add another time span
span1 = span1 - span2; // Subtract another time span
And finally the following methods exist to retrieve component information from an instance of the class:
Serial.print(span1.days()); // Extract days from DateTime
Serial.print(span1.hours()); // Extract hours from DateTime
Serial.print(span1.minutet()); // Extract minutes from DateTime
Serial.print(span1.seconds()); // Extract seconds from DateTime
Serial.print(span1.totalseconds()); // Extract total number of seconds in span
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