Skip to content

Instantly share code, notes, and snippets.

View brooksware2000's full-sized avatar

Curtis Brooks brooksware2000

View GitHub Profile
@brooksware2000
brooksware2000 / PROCESS_PHASE-COMPUTE_PID.ino
Created August 7, 2012 02:17
Routines to compute PID value and regulate heater controls
'-------------------------------------------------------------------------------
' Regulates heater controls based on phase temperature parameters
'-------------------------------------------------------------------------------
PROCESS_PHASE:
GOSUB READ_TEMPERATURE
GOSUB COMPUTE_PID
WHILE (elapsedTime <> 0)
IF (SecondsChanged = 1) THEN
elapsedTime = elapsedTime - 1
@brooksware2000
brooksware2000 / READ_TEMPERATURE.ino
Created August 7, 2012 02:07
MAX6675 temperature sampling routine. Routine stores sampled values in an array and returns the average.
'-------------------------------------------------------------------------------
' Read temperature
'-------------------------------------------------------------------------------
READ_TEMPERATURE:
'Get a sampling of temperature values and write to temperature array
FOR index = 0 TO BUFFERSIZE - 1
LOW CS
SHIFTIN DAT, CLK, 0,[curTemp\16]
HIGH CS