Did you write the code, or is it cut and paste from some other example?
You need to post more details, hardware config etc. - There are other examples of reading multiple DS18B20's, but the one I use has individual pins for each sensor, rather then individually addressed on the one bus wire, and uses a case statement in the selection process. I also use DT's 18B20 include file which makes working with these sensors a lot simpler
Code:
SelectSensor:
SELECT CASE Channel
CASE 0 : @ DS1820_Select _TempSensor1 ; Select the DS18x20 pin
CASE 1 : @ DS1820_Select _TempSensor2
CASE 2 : @ DS1820_Select _TempSensor3
CASE 3 : @ DS1820_Select _TempSensor4
END SELECT
RETURN
Bookmarks