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

Missing gain setting (0.88 G) #9

Open
groundstate opened this issue Dec 2, 2020 · 3 comments
Open

Missing gain setting (0.88 G) #9

groundstate opened this issue Dec 2, 2020 · 3 comments

Comments

@groundstate
Copy link

The code does not support the 0.88 G setting.
I've added it myself and it seems to work.
Is there a reason it's missing?

@ladyada
Copy link
Member

ladyada commented Dec 2, 2020

this sensor is discontinued many years ago so we can't test or verify anything about it - we dont own one anymore!

@groundstate
Copy link
Author

OK, but versions of the board are still available and it's still useful because it has lower noise than eg the LIS3MDL.

For anyone reading this who wants to use the 0.88G mode, just add
HMC5883_MAGGAIN_0_9 = 0x00, // +/- 0.88
to the magnetometer gain settings in the .h and
case HMC5883_MAGGAIN_0_9:
_hmc5883_Gauss_LSB_XY = 1370;
_hmc5883_Gauss_LSB_Z = 1370;
break;
to Adafruit_HMC5883_Unified::setMagGain() in the .cpp
I have used conversions from the datasheet but maybe you want to scale the Z conversion (decrease by 12%) like the others in the switch(gain)

@ladyada
Copy link
Member

ladyada commented Dec 3, 2020

yah current breakouts are not real hmc's, they're knockoffs - you could submit a PR and we may do a sweep at some point to merge in!

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