Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Routine to quickly ramp temperature up to the setpoint value
'-------------------------------------------------------------------------------
' Ramps up to setpoint
'-------------------------------------------------------------------------------
RAMP_UP:
GOSUB StartTimer
WHILE (curTemp < setpoint)
IF (SecondsChanged = 1) THEN
GOSUB READ_TEMPERATURE
GOSUB COMPUTE_PID
TimeOn = (cycleTime * OutVal)/100
Tvar = Tvar + 1
IF (Tvar >= outMax) THEN Tvar = outMin
IF (Tvar < TimeOn) THEN
PORTPIN = 1 : PINSTATE = 1 : GOSUB SET_PIN
ELSE
PORTPIN = 1 : PINSTATE = 0 : GOSUB SET_PIN
ENDIF
GOSUB DISPLAY_STATUS
SecondsChanged = 0
ENDIF
WEND
RETURN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment