2021-05-19 01:37 AM
I saw below topics.
How can i see discussion 71915817?
***
The datasheet doesn't specify how to convert register (OUT_TEMP_L (0Ch), OUT_TEMP_H (0Dh) ) data to actual temperature.
let's say for example if reg 0x0c = 0x7 value and reg 0x0d = 0x00 value, then what will be the temperature.
https://community.st.com/s/question/0D50X00009XkeF4SAJ/lis2dh-raw-output-to-temperature-conversion
***
Solved! Go to Solution.
2021-05-19 08:11 AM
Hi @BBQ ,
I suggest you to check the C drivers on Github for the LIS2DH --> lis2dh_reg.c
float_t lis2dh_from_lsb_nm_to_celsius(int16_t lsb)
{
return (((float_t)lsb / 64.0f) / 4.0f) + 25.0f;
}
float_t lis2dh_from_lsb_lp_to_celsius(int16_t lsb)
{
return (((float_t)lsb / 256.0f) * 1.0f) + 25.0f;
}
If my reply answered your question, please click on Select as Best at the bottom of this post. This will help other users with the same issue to find the answer faster.
-Eleon
2021-05-19 08:11 AM
Hi @BBQ ,
I suggest you to check the C drivers on Github for the LIS2DH --> lis2dh_reg.c
float_t lis2dh_from_lsb_nm_to_celsius(int16_t lsb)
{
return (((float_t)lsb / 64.0f) / 4.0f) + 25.0f;
}
float_t lis2dh_from_lsb_lp_to_celsius(int16_t lsb)
{
return (((float_t)lsb / 256.0f) * 1.0f) + 25.0f;
}
If my reply answered your question, please click on Select as Best at the bottom of this post. This will help other users with the same issue to find the answer faster.
-Eleon