Currently the library returns 54.67 for the readObjectTempC() if the sensor is not connected and it is hard to determine if the reading was successful or not (without calling begin()).
I suggest to add checks if the reading is successful or not. If it's not, the function should return NaN
EDIT: It seems like the function is returning -273.01, not 54.67 when the sensor is not connected. However, I still believe that returning NAN would be better.
EDIT 2: I've noticed that if the sensor is not connected readObjectTempC() sometimes returns -273.01 and sometimes 54.67 which makes it even harder to check if the reading i successful.
Currently the library returns
54.67
for thereadObjectTempC()
if the sensor is not connected and it is hard to determine if the reading was successful or not (without callingbegin()
). I suggest to add checks if the reading is successful or not. If it's not, the function should returnNaN
EDIT: It seems like the function is returning
-273.01
, not54.67
when the sensor is not connected. However, I still believe that returningNAN
would be better. EDIT 2: I've noticed that if the sensor is not connectedreadObjectTempC()
sometimes returns-273.01
and sometimes54.67
which makes it even harder to check if the reading i successful.