Version 0.0.1, +05:30 09:01:40 PM 18-05-2024, Saturday
CSE_MillisTimer- A class to wrapmillis()function call and variables.
This constructor creates a new CSE_MillisTimer object. A demo object names myTimer will be used for the documentation.
CSE_MillisTimer myTimer (uint32_t period, bool toReverse);uint32_t period: The period in milliseconds.bool toReverse: By default, the timer returnstruewhen the timer has elapsed andfalseotherwise. You can reverse this response by setting this argument totrue. Default isfalse.
CSE_MillisTimer object.
Starts the timer by calling the millis() function and saving the current time as a counter value. You can set the initial state of the timer (elapsed or not elapsed) by passing the state value.
myTimer.start (bool startState);bool startState: The initial state of the timer. Default istrue.
None
Checks if the timer has elapsed by comparing the current time with the time when the timer was started.
myTimer.isElapsed();None
bool:trueif the timer has elapsed,falseotherwise. This logic will be reversed if the constructor was called with thetoReverseargument set totrue.
Returns the exact opposite of isElapsed().
myTimer.isRunning();None
bool:trueif the timer is running,falseotherwise. This logic will be reversed if the constructor was called with thetoReverseargument set totrue.