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

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
' -----[ Title ]-----------------------------------------------------------
' Process control - IncubatorPID-SP.bs2
' Controls an incubator using PID control.
' StampPlot is used to perform calculations
' {$STAMP BS2}
' {$PBASIC 2.5}
' -----[ Declarations ]----------------------------------------------------
ADC_DataIn
TempF
LED
ADC_CS
ADC_Clk
ADC_Dout
ADC_Vminus
ADC_Vref
Heater
Fan
DriveTime
PWMVal
x
Offset
Span
' -----[ Initialization ]--------------------------------------------------
' -----[ Main Routine ]----------------------------------------------------
DO
LOOP
' -----[ Subroutines ]-----------------------------------------------------
' **** Set ADC Span and offset and read ADC value
READADC:
LOW Fan
PAUSE 1000
GOSUB ReadSP
GOSUB ReadADC
GOSUB UpdateSP
GOSUB GetSPDrive
GOSUB ControlIncubator
PWM ADC_Vminus,Offset * 255/500,100
PWM ADC_Vref,Span * 255/500,100
LOW ADC_CS
SHIFTIN ADC_Dout,ADC_Clk, MSBPOST,[ADC_DataIn\9]
VAR Byte
VAR Word
PIN 0
PIN 13
PIN 14
PIN 15
PIN 11
PIN 10
PIN 5
PIN 0
VAR Byte
VAR Byte
VAR Byte
VAR Byte
VAR Byte
' Analog to Digital Converter data
' LED output pin
' ADC Chip Select pin
' ADC Clock pin
' ADC Data output
' ADC Offset Value
' ADC Span reference
' Incubator Heater
' Incubator Fan
' number of seconds (x4 for PWM) to drive
' PWM Value to drive heater
' Working variable
' ADC Offset value (tenths)
' ADC SPan value (tenths)
' Connection Stabilization
' Read values from StampPlot

Related parts for 122-28176