Hi, I’m trying to create a 1 shot timer controlled by a switch. The actual programme is using the oneButton Library to control the switches, as there will be several of them. this Library puts each switch event into its own void function, as below. This works great for each switch. For PWM & on off control.
However I can’t get a millis timer working. The standard delay() timer works fine. But the millis timer starts, but won’t stop. hence the question below.
I can get the LED to turn off with a long switch press, but that isn’t stopping the timer.
The outputs drive some FET transistors hence why they are called FET1, etc
The device I am using is a nano
I’m sure its something simple, but I have been playing with this for a couple of days, on and off & can’t get it to work.
timer_not_working.ino (2.69 KB)