milesburton / Arduino-Temperature-Control-Library

Arduino Temperature Library
https://www.milesburton.com/w/index.php/Dallas_Temperature_Control_Library
969 stars 487 forks source link

Disconnected sensor messes up sensor indices #226

Closed janifr closed 2 years ago

janifr commented 2 years ago

Disconnecting sensor 0 on 2 sensor system causes sensor 1 to return value -127 and sensor 0 return temperature of sensor 1 making data useless.

milesburton commented 2 years ago

This is expected behavior. If you need consistency because you are disconnecting ICs, you'll need to use the getByAddress function

On Mon, 1 Aug 2022 at 08:30, janifr @.***> wrote:

Disconnecting sensor 0 on 2 sensor system causes sensor 1 to return value -127 and sensor 0 return temperature of sensor 1 making data useless.

— Reply to this email directly, view it on GitHub https://github.com/milesburton/Arduino-Temperature-Control-Library/issues/226, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJGHMZT3N7M6KBAHNPMR5LVW54KLANCNFSM55GQCVAQ . You are receiving this because you are subscribed to this thread.Message ID: @.*** com>

janifr commented 2 years ago

Thank you for super fast response! Could you please point me an example how to use the getByAddress function?

milesburton commented 2 years ago

See line 51 and go from there: https://github.com/milesburton/Arduino-Temperature-Control-Library/blob/master/examples/Multiple/Multiple.ino

janifr commented 2 years ago

Thanks, problem solved. If anyone's interested, my code is here: https://github.com/janifr/esp8266_dallastemperature_aws_iot