27220 Parallax Inc, 27220 Datasheet - Page 217

BOOK STAMPWORKS

27220

Manufacturer Part Number
27220
Description
BOOK STAMPWORKS
Manufacturer
Parallax Inc
Datasheet

Specifications of 27220

Accessory Type
Booklet
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
StampWorks
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Not applicable / Not applicable
' -----[ I/O Definitions ]-------------------------------------------------
Vin
DacIn
DacOut
' -----[ Variables ]-------------------------------------------------------
adcVal
bias
result
mVolts
' -----[ Initialization ]--------------------------------------------------
Check_Stamp:
Setup:
' -----[ Program Code ]----------------------------------------------------
Main:
' -----[ Subroutines ]-----------------------------------------------------
' Simple ADC conversion
' -- outputs voltage on P3 until it crosses voltage on P2
#IF ($STAMP <> BS2PX) #THEN
#ENDIF
DEBUG CLS,
DO
LOOP
#ERROR "This program requires the BS2px"
GOSUB Get_ADC
mVolts = adcVal */ $139B
DEBUG CRSRXY, 9, 2,
PAUSE 250
"BS2px ADC Demo", CR,
"==============", CR,
"Raw.....
"Volts...
DEC adcVal, "
CRSRXY, 9, 3,
DEC1 (mVolts / 1000), ".",
DEC3 mVolts
PIN
PIN
PIN
VAR
VAR
VAR
VAR
", CR,
"
1
2
3
Byte
Byte
Bit
Word
",
' unknown voltage input
' input from R/C DAC
' DAC via PWM + R/C
' adc value (0 - 255)
' bias for ADC conversion
' comparator result bit
' input in millivolts
' read comparator ADC
' convert to millivolts
' show results

Related parts for 27220