pulse within certain time?

i don't know how to do a delay with my following project. i cant use millis because millis starts immediately after upload or reset.

i have a push button on input 2.

led on pin 5.

now i want a timed delay so that initial button press will light up the led.

if the push button hasnt been pressed within the next 5 second. turn off the led or else keep the led on.

(really using a current switch to show if the stove is on or not. the stove current goes high to low because the element eventually gets to the required temperature but i want to show that the switch is still closed its just not time for current to flow yet but indications is that the stove is on. or led in my example).

thankk you. i don't have any source code that i i started with but i did alot of example.

debounce doesnt really work because it ignores 'noice' i want to ideally continually hear noise but only do something if the signal is there within a specific period of time.

thank you!

Of course you can use millis(). It is not only possible, it is the right way to do it. When button is pressed save the time in a variable. When millis()-variable is greater than 5000 you know 5 seconds has passed.

Now you should write code and show us.

No I cannot use Millis. Say I reset my board and walk away and come back, if it's programmed to check at 5 second, it won't work because Millis will be at a already be much higher value, millis starts ticking as soon as the board gets power or reset or new upload.

maybe i don't have enough coding knowledge to do this.

Have a look at this Tutorial: Arduino timing methods with millis() | tronixstuff.com