Main Site Documentation

Retrieving serial number from I2C device


#1

Has anyone attempted to retrieve the serial # from a DS18S20 I2C device? I don’t want to reinvent the wheel especially when there is better code out there.


#2

DS18S20 is NOT a I2C device but a OneWire device.
Code can be found here: http://code.tinyclr.com/project/157/onewire-temp-sensor-example-ds18b20/ and http://code.tinyclr.com/project/236/ds18b20-temp-sensor-with-async-events/

Look here for how to get the address (serial#): http://www.tinyclr.com/forum/10/609/#/1/msg4662

Note that the only difference between a DS18S20 and a DS18B20 is the resolution.

Greetings


#3

I looked at that code and there is not a method for retrieving the serial number.


#4

This will print the address:


while (ow.Search_GetNextDevice(OW_address)
    {
        OW_number++;
       for (i=0;i<8;i++) debug.print(OW_address[i]+":");
    }


#5

Thank you.That is much cleaner than the code that I wrote.