Adjust temperature values with offset and sensitivity
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
This commit is contained in:
parent
12819f8d26
commit
43e37b17dd
2 changed files with 3 additions and 2 deletions
|
@ -127,7 +127,7 @@ struct device3_t {
|
||||||
bool claimed;
|
bool claimed;
|
||||||
|
|
||||||
uint64_t last_timestamp;
|
uint64_t last_timestamp;
|
||||||
float temperature;
|
float temperature; // (in °C)
|
||||||
|
|
||||||
void* offset;
|
void* offset;
|
||||||
device3_ahrs_type* ahrs;
|
device3_ahrs_type* ahrs;
|
||||||
|
|
|
@ -712,7 +712,8 @@ int device3_read(device3_type* device, int timeout) {
|
||||||
|
|
||||||
int16_t temperature = pack16bit_signed(packet.temperature);
|
int16_t temperature = pack16bit_signed(packet.temperature);
|
||||||
|
|
||||||
device->temperature = (float) temperature;
|
// According to the ICM-42688-P datasheet: (offset: 25 °C, sensitivity: 132.48 LSB/°C)
|
||||||
|
device->temperature = ((float) temperature) / 132.48f + 25.0f;
|
||||||
|
|
||||||
FusionVector gyroscope;
|
FusionVector gyroscope;
|
||||||
FusionVector accelerometer;
|
FusionVector accelerometer;
|
||||||
|
|
Reference in a new issue