Skip to content
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

GYRO_CONFIG #7

Open
gaopeng-sheng opened this issue Jul 12, 2022 · 1 comment
Open

GYRO_CONFIG #7

gaopeng-sheng opened this issue Jul 12, 2022 · 1 comment
Assignees

Comments

@gaopeng-sheng
Copy link

First, you have done a great job. Recently I have played with MPU6050 and your code really helps me a lot. Thank you very much.
But as I follow the code line by line, I perhaps find something wrong.

bus.write_byte_data(DeviceAddress, GYRO_CONFIG, 24)

In the line, you define the register of GYRO_CONFIG as 24 ( 24 = 0001 1000 ). And we can find the register GYRO_CONFIG on page 14 in the register map document. So with 0001 1000, we know the bit 3 and bit 4 are both 1. That is to say FS_SEL = 3. As I know, it means that you choose a Full Scale Range of +-2000 deg/s.
Now, we can see on page 31, with a Full Scale Range of +-2000 deg/s, the LSB sensitivity should be 16.4LSB/s.

But in your code, I see this. gyroXRate = gyroX/131 gyroYRate = gyroY/131
Should this be like that? gyroXRate = gyroX/16.4 gyroYRate = gyroY/16.4

@rocheparadox
Copy link
Owner

@Gaops , Thanks for the compliment. It means a lot. I was hooked with up with something else and this message of yours was overlooked. Sorry for that.

I think you are right. I will verify the math once again with the documents and update the code ASAP.
Thanks for taking your time to report this. Cheers!

@rocheparadox rocheparadox self-assigned this Aug 16, 2022
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

2 participants