bbrendon
Active Member
I'm using an output to turn my heater on/off. I think my biggest problem is doing nested if's. What I've written so far just keeps turning the heater off every second. I want to:
if heater on (OP1=1)
has it been on for 20+ min? turn off
is t1 > 75 degreess? turn off
endif
Thanks for any pointers on this.
START
CALLSUB HVAC_SAFE
END
HVAC_SAFE:
TSTEQ OP1 1 # if OP1 is on
TSTGT T1 750 # and If > 75.0 deg, turn it off.
CALLSUB HVAC_OFF
RET
HVAC_OFF:
SET OP1 0
EMAIL EM3
RET
if heater on (OP1=1)
has it been on for 20+ min? turn off
is t1 > 75 degreess? turn off
endif
Thanks for any pointers on this.
START
CALLSUB HVAC_SAFE
END
HVAC_SAFE:
TSTEQ OP1 1 # if OP1 is on
TSTGT T1 750 # and If > 75.0 deg, turn it off.
CALLSUB HVAC_OFF
RET
HVAC_OFF:
SET OP1 0
EMAIL EM3
RET