Interval based actions with minimum external library

Yes, what Armor said. millis() is the best way to handle this, and make sure you structure it exactly like that:

if (millis() - lastTime >= interval)

This is necessary to make sure millis rollover does not cause problems:

1 Like