Hi, I've no experience in getting the info from more than one sensor, but I've found some other approach to the DS18B20.
Seems that:
Code:
Temp VAR WORD
ID VAR BYTE[8] '64 bit memory array
OWOUT Pin, 1, [$33] 'This read the internal eeprom of the sensor
OWIN Pin, 0,[STR ID\8] 'Save the result into a 8 byte array
SELECT CASE ID[0]
CASE $28
'a DS18B20 has been found
CASE $10
'a DS18S20 has been found
END SELECT
OWOUT Pin, 1, [$CC, $44] ' Jump the ROM and convert
PAUSE 900 ' Give enough time for conversion (you could reduce it using 10 bit resolution)
OWOUT Pin, 1, [$CC, $BE]' Jump the ROM and read
OWIN Pin, 2, [Temp.Lowbyte, Temp.Highbyte] ' Read 2 bytes
As said I've not experience in using more than one of those sensor, but probably there is a way to choose wich one using the data of the internal EEPROM.
If you get some result, please post your experience for future use.
Bookmarks