I need some help as I can't get an example program running and as I new to SF, I have properly made a newbie mistake.
The program below goes to the find function, but never comes back. I have proven this by forcing a true or false from within the DS18B20 module.
I'm using version 2.2.0.5 and ICC 1.1.5.5
Code: Select all
Device = 18F4620
Clock = 10
Include "usart.bas"
Include "DS18B20.bas"
Include "convert.bas"
Dim LED As PORTC.0 ' Status LED
Dim TempA As ShortInt ' Temp C from DS18B20
Dim TempB As Word ' Temp C from DS18B20
Dim tempf As Word ' Temp converted from C to F
SetBaudrate (br9600) ' Set serial port to 9600 baud
SetPin(PORTE.0) ' Assign pin RE0 to temperature probe
Low(LED) ' Set status LED to off
USART.Write ("Get Ready.....", 10, 13)
If Not Find Then ' Look for temperature probe
USART.Write ("No temp probe", 10, 13)
Else ' Temperature probe found, process normally...
While true ' Do this loop forever
High (LED) ' Turn ON LED to show activity
Convert
GetTemp(TempA, TempB)
tempf = (TempA*1.8)+32
USART.Write ("Temp = ", DecToStr(tempf), 10, 13)
DelayMS (200)
Low (LED)
DelayMS (500)
Wend
EndIf