There appears to be a casting issue in this function that is causing negative temperatures to be returned as larger positive values. Specifically in this line : temp_raw_scaled = (int32_t)data[BMA4_TEMP_BYTE] * BMA4_SCALE_TEMP; Test case to demonstrate: set data = 0x81 The expected return value in deg C would be -104C Actual return value is 152,000 C
... View more