Well I've had an implementation of this working great for months now. Its counts down 20 minutes, turns off the output, flashes an LED using the pause command, then sits there waiting for the input to start again.
I need to add a feature now though. As the time reaches 15 minutes, I need it to flash an LED at 2Hz while still counting down and turning off at 20 minutes.
Currently the code is like this:
Code:
IF MinutesChanged THEN
MinutesChanged = 0
IF Minutes = 20 THEN
HPWM 1, 0 , 30000
POWER = 0
LEDS = 0
CURRENT = 0
If I change it to this will it do what I need it to do? Second thing is if it will, how do I flash an LED while still running the main program? I am using HPWM already.
Code:
IF MinutesChanged THEN
MinutesChanged = 0
IF Minutes = 15 THEN
GOSUB Flashyflashy
ENDIF
IF MinutesChanged THEN
MinutesChanged = 0
IF Minutes = 20 THEN
HPWM 1, 0 , 30000
POWER = 0
LEDS = 0
CURRENT = 0
ENDIF
Bookmarks