The project ignores you while it waits (delay)

  • Arduino
  • ESP32

Why it happens

  • Long delay() calls in loop().
  • Waiting for a sensor or Wi-Fi inside a while loop.

How to fix it

  1. Make the delays short.
  2. Use millis() to check the time instead of stopping.
  3. Hold the button until the light changes to see if the delay is the problem.

It worked if: The button reacts straight away.

From how the part works. Explained from how delay() works.

Didn't help? Search another error or ask us.