-
Notifications
You must be signed in to change notification settings - Fork 110
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
Erroneous Arduino values #11
Comments
Any solution ? |
After hard iron calibration code work perfectly. Before use values from heading, first make 360 degree horizontal rotation. In gits can see: arduino-BerryIMU code with hard iron calibration. https://gist.github.com/vbahtev/b05f1895776cec5828db6746d5ba9a11 |
In my case it turned out to be bit shifting with assumption that the Arduino would be 16bit where as the zero was 32bit (from what I remember). Never got it working though, thanks for sharing the code! |
I've gotten similar results. Like @Honest-Objections stated I believe it is a calculation error, solutions may be unique depending on the board. Please let us know what board this was designed using, and if there are any known solutions. I will be trying to correct it for an SAMD (ItsyBitsy M0 Express). Thank you for the nice library. -Aaron
|
The issue is that 32 bit processors create 32 bit signed integers when "int" is called. The LMD9DS sensors are set up to output information into 16 bit signed integers, which the author has exemplified for us well:
Quoted from: http://ozzmaker.com/compass1/ The Arduino example code should work nicely with no modifications on a 16 bit processor and 16 bit Arduino. For a 32 bit or other processor, simply change all the "int" calls to "int16_t" and the issue will be solved. (Do not use "uint16_t" as this is unsigned, eg: cannot be negative). "int" calls and "int16_t" calls both natively use 2's compliment to store their numbers, so conversion to decimal is not necessary. -Aaron |
While I may just be misunderstanding entirely, I would expect the Arduino code to spit out degrees between 0-360. When running on the GPS-IMU V2 I get:
So the heading seems fine, I don't know what's going on with the rest of it.
The text was updated successfully, but these errors were encountered: