122-28176 Parallax Inc, 122-28176 Datasheet - Page 245

GUIDE STUDENT PROCESS CONTROL

122-28176

Manufacturer Part Number
122-28176
Description
GUIDE STUDENT PROCESS CONTROL
Manufacturer
Parallax Inc
Datasheets

Specifications of 122-28176

Accessory Type
Manual
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
Propeller Education (PE) Kit
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
LOOP
' -----[ Subroutines ]-----------------------------------------------------
ReadSP_Span:
ReadSP_Controls:
CalcTripPoints:
SetADC:
ReadADC: ' Read ADC 0831
CalcTemp:
Drive_Heater:
GOSUB SetADC
GOSUB ReadADC
GOSUB CalcTemp
GOSUB Drive_Heater
GOSUB PlotTemp
PAUSE 500
DEBUG CR,"!READ (txtTMin)",CR
DEBUGIN DEC V_Offset
PAUSE 50
DEBUG "!READ [(txtTMax),-,(txtTMin)]",CR ' Obtain value for ADC Span
DEBUGIN DEC V_Span
PAUSE 50
RETURN
DEBUG "!READ [(txtSetPoint),*,100]",CR
DEBUGIN DEC SetPoint
PAUSE 50
DEBUG "!READ [(txtBand),*,100]",CR
DEBUGIN DEC Band
PAUSE 50
DEBUG "!READ (swFan)",CR
DEBUGIN Fan
PAUSE 50
RETURN
UTP = SetPoint + Band
LTP = SetPoint - Band
RETURN
PWM ADC_Vminus, V_Offset * 255/500,100
PWM ADC_Vref, V_Span * 255/500,100
RETURN
LOW ADC_CS ' Enable chip
SHIFTIN ADC_Dout, ADC_Clk, MSBPOST,[ADC_ByteValue\9] ' Clock in ADC data
HIGH ADC_CS ' Disable ADC
RETURN
TempF = (V_Span * 100)/255 * ADC_ByteValue + (V_Offset * 100)
RETURN
IF (TempF < LTP) THEN
' Transfer function for temperature in hundredths
' Obtain value for ADC Offset
' Obtain band in hundredths
' Obtain fan based on state
' Calculate UTP
' Calculate LTP
' Obtain setpoint in hundredths
' Set Voltage for ADC Vminus
' Set voltage for ADC Vref

Related parts for 122-28176