2016-09-28 03:35 AM
Hi,
LIS3DH, I don't move it. Sampling rate 400 Hz, CTRL_REG2=0.+-2g full scale : (0g;0g;1g) out value+-4g full scale : (0g;0g;1g) out value+-8g full scale : (0g;0g;1g) out value+-16g full scale : (0g;0g;0,67g) out valueWhat is going wrong?
2018-05-09 01:51 AM
I'm not sure you function is correct, because I don't know what are the variable types.
For reference please see my code.
int16_t result_lsb;
float result_mg;
result_lsb = ((int16_t)high_byte<<8)+(uint16_t)low_byte;
result_mg = result_lsb * sensitivity; // LSB to mg, see sensitivity in datasheet
Did you check that you get 1g of gravity when the device is still?
2019-03-06 02:03 AM
Hello
A bit late to the party but since i didn't find an answer, here's my scenario:
LIS3DSH configured at high resolution mode, being polled at 40 Hz
I read ZH=A6(166), ZL=F0 (240)
Converted to 16 bit, I get num=(A6<<8 )+ (F0)
I shift by 4: num=num>>4, i get 2671
then i get the signed value: -1425
Then i multiply by 12 mg/digit, the sensitivity, i get -17.1 g
The value in itself is not necessarily wrong (the sensor is subjected to shocks higher than 16g), but the question is why does the sensor report a higher value.
thank you