How to make a button initialize after 10 seconds

My app has a switch-mode button with a virtual pin.
When I touch this button, it remains on. (Press again to turn off)
How do I write the code so that the timeout is automatically reset to off (for example, 10 seconds)?

Blynk.virtualWrite (V13,0);

I know I need to use this function.
I’d appreciate it if you could give me a code to set a timeout.

If the delay function is used, the button operation is impossible during the delay time.
So I want to make it work by measuring the time when the button operation does not occur.

You must use something like timers, you can try tasker.h

After button activation create a task to run another function after X seconds…

Or you can use the search function, and look to see if something like this has been discussed here before.

Sometimes the answer is right there in front of you, if you are willing to look for it.

1 Like

No le des la respuesta sencilla… deja que se debane los sesos con mi respuesta :stuck_out_tongue: