I suggest printing the values of beginTime, timeInterval, etc. in the Serial monitor so you can understand the problem more. You also need to come up with formulas as millis() does not reset. Formula/s to get the 20 seconds button satisfied.
I suggest printing the values of beginTime, timeInterval, etc. in the Serial monitor so you can understand the problem more. You also need to come up with formulas as millis() does not reset. Formula/s to get the 20 seconds button satisfied.