You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used your library with some small changes. Instead of using 4g for the accelerometer, I tried to switch to 16g. So, I modified the following lines:
in the begin method used: writeRegister(LSM9DS1_ADDRESS, LSM9DS1_CTRL_REG6_XL, 0x88);//0x70 is 119 Hz, 4G, and 0x88 is 238Hz, 16G
Then in the readAcceleration methods to:
int LSM9DS1Class::readAcceleration(float& x, float& y, float& z)
{
int16_t data[3];
if (!readRegisters(LSM9DS1_ADDRESS, LSM9DS1_OUT_X_XL, (uint8_t*)data, sizeof(data))) {
x = NAN;
y = NAN;
z = NAN;
return 0;
}
x = data[0] * 16.0 / 32768.0;
y = data[1] * 16.0 / 32768.0;
z = data[2] * 16.0 / 32768.0;
return 1;
}
When reading the data with the arduino faced up I read values like this:
0.02 0.03 0.68
which does not seem correct since z, should output 1.0g
After further investigation I use 24.0g for the scale and the output was correct and as expected
Am I doing some wrong? or am I the only one facing this problem?
Thanks in advance
Best regards,
The text was updated successfully, but these errors were encountered:
When calculating the scale for the sensitive one cannot use SCALE/32768. This formula works others for all the others sensitivities on the accelerometer but fails for the 16G.
According to the datasheet:
but 16/32768 does not correspond to the sensitity value. However 24g will give that value. I have contacted ST to advise.
Hi all,
I used your library with some small changes. Instead of using 4g for the accelerometer, I tried to switch to 16g. So, I modified the following lines:
in the begin method used:
writeRegister(LSM9DS1_ADDRESS, LSM9DS1_CTRL_REG6_XL, 0x88);//0x70 is 119 Hz, 4G, and 0x88 is 238Hz, 16G
Then in the readAcceleration methods to:
When reading the data with the arduino faced up I read values like this:
0.02 0.03 0.68
which does not seem correct since z, should output 1.0g
After further investigation I use 24.0g for the scale and the output was correct and as expected
Am I doing some wrong? or am I the only one facing this problem?
Thanks in advance
Best regards,
The text was updated successfully, but these errors were encountered: