Give a temporization if condition is ON

If your condition is true,

  1. set a timer (based on millis()) once,
  2. set a flag that the timer is started

You will have to incorporate the flag in the condition

If the condition is false

  1. reset the flag

If the flag is true

  1. check the millis() time to see if a certain duration has lapsed and take the desired action.

Your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advice on) your project :wink: See About the Installation & Troubleshooting category.