signedMag12ToFloat issue for negative numbers
espHorst opened this issue · 1 comments
espHorst commented
I think that the last line of function
float Adafruit_AMG88xx::signedMag12ToFloat(uint16_t val)
{
//take first 11 bits as absolute val
uint16_t absVal = (val & 0x7FF);
return (val & 0x8000) ? 0 - (float)absVal : (float)absVal ;
}
should read
return (val & 0x800) ? 0 - (float)absVal : (float)absVal ;
according to the data sheet page 13 as the thermistor only returns 12 bit.
deanm1278 commented
fixed!