22template <timefunction time = micros>
30 Timer(
unsigned long interval) : interval(interval) {
42 if (
now - previous >= interval) {
52 void setInterval(
unsigned long interval) { this->interval = interval; }
56 unsigned long previous = 0;
#define BEGIN_AH_NAMESPACE
A class for easily managing timed events.
unsigned long getInterval() const
Get the interval of the timer.
Timer(unsigned long interval)
Constructor.
void setInterval(unsigned long interval)
Set the interval of the timer.
void beginNextPeriod()
Initialize or reset the timer. The timer will fire after one period.
void begin()
Initialize or reset the timer. The timer will fire immediately.
An array wrapper for easy copying, comparing, and iterating.