0PricingLogin
Arduino & IoT Academy · Lesson

Debounce with millis()

Ignore noise with a short stability window.

Why Not Just delay()?

You could pause with delay() after a press, but that freezes your whole board. The smarter tool for clean buttons is millis().

millis() Is a Stopwatch

millis() returns how many milliseconds your board has been running. You compare two readings to measure elapsed time without stopping.

unsigned long now = millis();

All lessons in this course

  1. Why Buttons 'Bounce'
  2. Debounce with millis()
  3. Store a Value in EEPROM
  4. Remember a Counter After Reset
← Back to Arduino & IoT Academy