-
Notifications
You must be signed in to change notification settings - Fork 26
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
Magnetometer as Compass #11
Comments
Hi @dyk74 , it would be great to have a simple one-off magnetometer calibration but I don't think it's possible. One reason is that the magnetic field changes depending on the location, e.g. |
... sorry, writing from smartphone and hit the wrong button.... |
Hello, There are those who like to tweak and therefore for whom the more details there are, the more they like. Is it possible to have an example with only an output in ° of the direction from 0° to 360° |
Hi @froussel, in theory it's easy. Just turn the magnetometer in all directions and determine the max and min values for the x and y axis. You can define e.g. xmax as north xmin as south and use y values to eliminate the ambiguity of values in between (there are always two angles for each axis which will give the same magnetometer value). If you want to make it more robust, you also need to include the z-axis magnetometer value because if the sensor is not held horizontally it influences the x- and y values. |
I am using the libraries for a project with arduino; the magnetometer works however it gives me values that are not accurate. I would like to know if it is possible to calibrate the magnetometer (without using the 8 movement) to make it more accurate so that I can then use it as a compass.
The text was updated successfully, but these errors were encountered: