2019-10-25 02:00 AM
How can i convert 12 bit raw value from 0x0D & 0x0E to degree celsius?
2019-10-25 02:09 AM
Hi @User_of_Sensor , you have first to concatenate the OUT_T_L (0Dh) and the OUT_T_H (0Eh) register (16 bits). Then you consider only the first 12 bits, converting it in decimal value using 2's complement, divide for the sensitivity of 16LSB/°C and finally sum it to 25°C. You can find the driver code here
float_t iis2dlpc_from_lsb_to_celsius(int16_t lsb)
{
return (((float_t)lsb / 16.0f) + 25.0f);
}
Regards
2019-10-28 05:44 AM
Hello @Eleon BORLINI ,
Thank you for the reply. It works! Great
Best regards,