LIS3DH, how to calculate the x, y, z ?
Hi team,
I am working on LIS3DH sensor, and found a lot resource from internet.
But I go confused when I saw difference formula to calculate the OUTPUT_X or OUTPUT_Y.
Source1:
dt_usr[0] = float(short((data[1] << 8) | data[0]) >> 4) * fs_factor;
https://os.mbed.com/users/electronichamsters/code/LIS3DH/file/c32d2b25d4c2/LIS3DH.cpp/
source2:
dev->accX = INT16_TO_FLOAT(buf[1], buf[0]);
https://github.com/intel-iot-devkit/upm/blob/master/src/lis3dh/lis3dh.c
My question is why the source1 need to do " >> 4"? where can I get the detail information?
Could you have example code to calculate the OUTPUT_X,Y,Z?
Thanks.
