Skip to content

Instantly share code, notes, and snippets.

@brooksware2000
Created August 7, 2012 02:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brooksware2000/3280763 to your computer and use it in GitHub Desktop.
Save brooksware2000/3280763 to your computer and use it in GitHub Desktop.
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