Device = 18F1320
Clock = 8
// import modules...
Include "IntOSC_1320.bas"
Include "convert.bas"
Include "LCD.bas"
Include "DS18S20.bas"
Include "utils.bas"
Dim
TempA As ShortInt,
TempB As Byte // for the DS18S20.bas lib this is a WORD
SetPin(PORTA.0)
// Find() will search the bus for a single DS1820 device
// and load its ROM ID into the DS1820 public variable RomID - you
// could do this manually. For example, RomID = MyRomID...
SetAllDigital
If Not Find Then
LCD.Cls // Clear the LCD screen
LCD.WriteAt(1,1,"No device found") // Send some text to the LCD
Else
While true
ConvertAll
GetTemp(TempA, TempB)
LCD.WriteAt(1,1,Convert.DecToStr(TempA),".",DecToStr(TempB)," C") //
LCD.WriteAt(2,1,GetTempAsStr, " C") // The same as the line above
DelayMS(500)
Wend
EndIf