adafruit / Adafruit_LSM6DS

Arduino library for LSM6DS
Other
50 stars 41 forks source link

The scale range for the gyros don't add up: wrong calculation in constants? #40

Closed gauteh closed 1 year ago

gauteh commented 1 year ago

Hi,

in https://github.com/adafruit/Adafruit_LSM6DS/blob/master/Adafruit_LSM6DS.cpp#L479 the calculated scale for DPS is listed. E.g. 140 for a range of 4000 dps. The scale is said to be in milli-dps per bit. The value is i32, so the range is +/- 32767. The scale for e.g. 4000 should therefore be: 4000 * 1000 / 32767 = 122.074. However, it is listed as 140. All the other values for the gyro is also off.

For the accelerometer the values do make sense. Are the values for the gyro off?

Regards, Gaute

gauteh commented 1 year ago

It is correct as it is. Values listed in datasheet as mdps / LSB.