2024-09-19 11:20 PM
Greetings
I am working with the LIS2DW12 accelerometer. I am using the device in Low Power Mode 1, with a FS = +-4g.
According the application note AN5038, page 15, it says that the Low power mode 1, entails a 12 bit value. Thus, using the 16-bit value from the output registers for each axis, it should be divided by 4, and multiplied by 1.952:
Acceleration in mg = (16 bit hex value from both output registers)/4 * 1.952
Acceleration in mg = (16 bit hex value from both output registers) * 0.488
However in the GITHUB example code, found at the link (line 128)
float_t lis2dw12_from_fs4_lp1_to_mg(int16_t lsb)
{
return ((float_t)lsb) * 0.122f;
}
The above code snippet shows that the 16-bit hex value from both output registers, should be multiplied by 0.122.
I am not sure how to make sense of this.
Any help would be appreciated.
2024-11-08 06:59 AM
Hi @ZAIDS-S23 ,
The github example is in high performance mode and thus at FS=4g it is: 0.488/4, in LPM1 the right formula is yours.