27220 Parallax Inc, 27220 Datasheet - Page 173

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
Display_C:
Display_F:
' -----[ Subroutines ]-----------------------------------------------------
Read_DS1620:
Behind the Scenes
The largest organ of the human body is the skin and it is most readily affected by
temperature. Little wonder then that so much effort is put into environmental control
systems (heating and air conditioning).
This
thermometer/thermostat chip. This chip measures temperature and makes it
available to the BASIC Stamp through a synchronous serial interface. The DS1620 is
LOOP
HIGH Reset
SHIFTOUT DQ, Clock, LSBFIRST, [RdTmp]
SHIFTIN DQ, Clock, LSBPRE, [tempIn\9]
LOW Reset
tempIn.BYTE1 = -sign
tC = tempIn * 5
IF (tC.BIT15 = 0) THEN
ELSE
ENDIF
RETURN
GOSUB Read_DS1620
DEBUG CRSRXY, 0, 2,
DEBUG CRSRXY, 0, 3,
PAUSE 1000
tF = tC */ $01CC + 320
tF = 320 - ((ABS tC) */ $01CC)
experiment
(tC.BIT15 * 13 + " "),
DEC (ABS tC / 10), ".", DEC1 (ABS tC),
DegSym, " C", CLREOL
(tF.BIT15 * 13 + " "),
DEC (ABS tF / 10), ".", DEC1 (ABS tF),
DegSym, " F", CLREOL
uses
the
Dallas
Semiconductor
' get the temperature
' delay between readings
' alert the DS1620
' give command to read temp
' read it in
' release the DS1620
' extend sign bit
' convert to tenths
' temp C is positive
' convert to F
' temp C is negative
' convert to F
DS1620
digital

Related parts for 27220