Skip to content

Reading too many bits from OPR_MODE register for determing the operation mode #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
GuenterQ opened this issue Apr 18, 2021 · 3 comments

Comments

@GuenterQ
Copy link
Contributor

GuenterQ commented Apr 18, 2021

Hello friends,

According to Page 56 of the BNO055 datasheet (Rev. 1.7, November 2020), only bit0 - bit3 of OPR_MODE register represent the operation mode of the sensor.

However, in file adafruit_bno055.py, line 302, all of the eight bits are returned as the operation mode, which leads to strange behaviors as reported in #67. There, some physical values such as euler, quaternion etc. are shown as None, because a wrongly translated operation mode is out of range.

Suggestion:
return ( self._read_register(_MODE_REGISTER) & 0b00001111 )

Best Regards
GuenterQ

@ladyada
Copy link
Member

ladyada commented Apr 18, 2021

sure! please submit a PR :)

@ViennaMike
Copy link
Contributor

I concur with the issue and fix, but fyi, the Quaternion and Euler values returning NONE when they shouldn't were also sometimes caused by an error in another section of the program (issue 75, fixed by pull request 76).

@GuenterQ
Copy link
Contributor Author

This issue has been solved in #80.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants