adafruit / Adafruit_CircuitPython_BNO055

CircuitPython driver for BNO055 absolute orientation sensor
MIT License
85 stars 51 forks source link

Number of digit reported for accelerations ang gravity components are just two #88

Closed dimitrigrigoriev closed 1 year ago

dimitrigrigoriev commented 2 years ago

Is it possible to increase the accuracy of the reported accelerations to at least 8 digits? It is currently just two digits, however, in a 2G mode 14 bit ADC should have an LSB value of 0.002395019531250m/s^2 and we are loosing information.

ladyada commented 2 years ago

can you be more specific about what you mean, you can print out the value iwth more digits of precision in arduino?

dimitrigrigoriev commented 2 years ago

Hi Ladyada, I am using Python driver on the Raspberry Pi. My output currently is: Gravity (m/s^2): (0.62, -0.42, 9.77) When I try to format the output with five digits it just gives extra zeros: 0.62000 It looks like the number of digits is limited when data is converted from binary to float.

ladyada commented 2 years ago

could be - that precision may not be available!

dimitrigrigoriev commented 2 years ago

OK, but is it possible to get raw output out in in binary or in dec? If yes than I can convert the the data into needed precision on a higher level using range and offeset data.

ladyada commented 2 years ago

https://github.com/adafruit/Adafruit_CircuitPython_BNO055/blob/main/adafruit_bno055.py#L859 thats where the response is read from i2c, so you just have to call bno._read_register(0x28, 6) to get the raw data from that register

caternuson commented 1 year ago

Closing. Looks answered.