Open
Description
I've seen some weird behavior with my sensor when it dips below freezing (< 32 deg F, < 0 deg C) whereby the temperature reading is around 654 C and less. After posting this issue to the Adafruit forum, a support member suggested it was an unsigned integer problem. Since temperature register in the device is a 16 bit 2's complement value in 100ths of a degree. A temperature of -1C would be stored in binary as 1111 1111 1001 1100. Interpreted as a signed integer that is -100. As an unsigned integer it would be 65436. Since the library takes the contents of the register and divides by 100 - which results in the 654 that I am seeing.
Is it possible to fix this library bug?
Thanks!
Metadata
Metadata
Assignees
Labels
No labels