0Pricing
Arduino & IoT Academy · Lesson

Blink Without delay Using millis

Track elapsed time to run tasks on schedule.

A Built-in Stopwatch

The millis function returns how many milliseconds your board has been running since it powered on. It is a free, always-counting stopwatch. ⏱️

unsigned long now = millis();

Why unsigned long

Store millis in an unsigned long. The count grows huge over time, and a plain int would overflow in under a minute.

All lessons in this course

  1. int, float, bool on Arduino
  2. Why delay() Blocks Everything
  3. Blink Without delay Using millis
  4. Run Two Things at Once
← Back to Arduino & IoT Academy