Hi, The TMP102 library doesn’t produce output correctly for negative temperatures… instead it starts from 0=265 and works backwards… so -1 is reported as 255, -3.25 as 252.25 etc
Any clues how to fix the library so as to report the values correctly? Thanks.
The Stalker V2.0 has an onboard temperature sensor - the TMP102 - the code for the Stalker V2.0 is on the SeeedStudio Wiki and contains a Library for the TMP102 which is where I believe the problem lies. I am hoping you may be able to advise some changes to the TMP102 library code to solve this issue?
This code is not compatible with Arduino 1.0 IDE please use Arduino 0023 IDE.
The following code had to be added for negative temperatures to work properly.
temperature = (MSB << 8 ) | LSB;
temperature >>= 4 ; // Value is left shifted in above table. Hence Right shift.
temperature = temperature & 0xFFF;