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

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
Example Program: IncubatorDiffGap.bs2
' -----[ Title ]-----------------------------------------------------------
' Process Control - IncubatorDiffGap.bs2
' Controls using differential gap.
' {$STAMP BS2}
' {$PBASIC 2.5}
' -----[ Declarations ]----------------------------------------------------
ADC_ByteValue VAR Byte ' Analog to Digital Converter data
V_Offset
V_Span
TempF
SetPoint
Band
UTP
LTP
ADC_CS
ADC_Clk
ADC_Dout
ADC_VRef
ADC_Vminus
Heater
Fan
' -----[ Initialization ]--------------------------------------------------
LOW Heater
LOW Fan
PAUSE 1000
DEBUG CR,"!O lblBand.Delete",CR
' Create label control "lblBand"
DEBUG "!O oLabel.lblBand=82.5,64,13,3,(+/-):,,0,10,0",CR
DEBUG "!O lblBand.Font=Arial,10,1,0",CR
DEBUG "!O txtBand.Delete",CR
' Create text box control "txtBand"
DEBUG "!O oText.txtBand=92,64,7,5,1,15,0,11",CR
DEBUG "!RSET",CR
GOSUB ReadSP_Span
' -----[ Main Routine ]----------------------------------------------------
DO
GOSUB ReadSP_Controls
GOSUB CalcTripPoints
Enter, save and run BASIC Stamp program IncubatorDiffGap.bs2.
Close the Debug Terminal.
VAR Word ' Temperature/voltage for ADC offset
VAR Word ' Temperature/voltage for ADC Span
VAR Word ' Calculated temperature in hundredths
VAR Word ' Heater control setpoint
VAR Byte ' Setpoint band +/-
VAR Word ' Upper trip point based on band
VAR Word ' Lower trip point based on band
PIN 13
PIN 14
PIN 15
PIN 10
PIN 11
PIN 5
PIN 0
' ADC Chip Select pin
' ADC Clock pin
' ADC Data output
' Filtered PWM for ADC Vref
' Filtered PWM for ADC Vminus
' Incubator heater
' Incubator cooling fan
' Ensure heater off
' Ensure fan is off
' Allow connection stabilization
' Reset StampPlot
' Get settings for ADC
' Delete control if exists
' Set Font of lblBand
' Delete control if exists

Related parts for 122-28176