diff --git a/interface_lib/include/device3.h b/interface_lib/include/device3.h index 6189ad4..8a7a7d0 100644 --- a/interface_lib/include/device3.h +++ b/interface_lib/include/device3.h @@ -127,7 +127,7 @@ struct device3_t { bool claimed; uint64_t last_timestamp; - float temperature; + float temperature; // (in °C) void* offset; device3_ahrs_type* ahrs; diff --git a/interface_lib/src/device3.c b/interface_lib/src/device3.c index 8b12b6a..00fafb3 100644 --- a/interface_lib/src/device3.c +++ b/interface_lib/src/device3.c @@ -712,7 +712,8 @@ int device3_read(device3_type* device, int timeout) { 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 accelerometer;