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 serial-in/parallel-out shift registers, like the 74HC595 that are connected to the SPI bu...
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.