I'm trying to make a project where a led turns on when you press a button for example 1min.
But when you release the button the timer needs to count down.
For example if I press the button for 30 seconds and release it for 10 seconds, I still need to hold it for 40 seconds before the led can come on. ((30-10)+40)=60.
I can't seem to wrap my head around the code to do this, all I know how to use is the millis() function.
Any help is much appriciated!
Thanks in advance.