Testing my code for the HMC5843 turns out that the labeling for the axis may be wrong. The sign directions are different too. I checked against the Board from Sparkfun. Looking at the datasheet, the components axis described there are when you look at the bottom of the device. The schematic pictures is mirrored upside down to show a view from the top.
I already double checked the solder jumper, It´s connecting the center pad with the pad labeled 5V.
I´ll record the values supplied by the board and show in a time-stamp graph for a better understanding of the problem.
I´m thinking to make a non-sense trying: set-up the 5843 board to 3V and connect to the Arduino board through a logic level converter (Sparkfun)!
We don't see the problem on the APM board. You can see sample data here
Hi there, the problem I reported at http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1291403700 was mostly imputable to the ITG3200 rather than the magnetometer. See this for more details.
You can give a try to my Arduino library for the HMC5843 based on Wire.
First of all, thank you for your help. I already downloaded your library and I´ll try!!
IMPORTANT: I´m not using the SparFun board (3.3V) that needs a level converter to be connect to 5V devices, I´m using DIYdrones board that can deal with 3V3 and 5V devices. In this case it´s setted-up to 5V (no level converter required).
Great stuff. What do you use to display the orientation on screen?
I enhanced the original APM code for the HMC5843 for my purposes: Link (goto libraries)
Hi Uwe, I use Processing to display the cubes on the screen. It's a very simple programming language which perfectly fits the need of rapid graphics prototyping.
If you were talking about the 9DOF/DOM orientation filter above the Processing code is available on the attachments of my 9DOF/DOM blog post.
Can you give me some support regarding your code?
How ist the syntax/format of the string send to the processing prg?
Sure, the sensor fusion algorithm computes a quaternion which is a representation of the orientation of the body in 3d. A quaternion is stored in memory as four floating variables.
These variables are then sent over the wire using an HEX representation.The format should be:
Above, HEX_q1 means the hexadecimal representation of quaternion first component.
That's how I managed to send floats over serial without loss of precision. I wrote a blog post on this topic.
The Processing app just need to read the data from the serial interface, decode that back into a float and use the orientation data for displaying the rotated cube.
For more examples on Arduino, Serial and Processing check my blog post: Serial communication with Arduino and Processing: simple examples a...
Feel free to ask if you need more help.
I try now since hours to run your code on my APM board. But it does not work.
I do not know why, but when the calculated values are written back to q0..q3, this values remain zero at all.
May the compiler is wrong. I found that A = A + 1 is not working correctly until I write it like this: A =+ 1
Very strange all this things. At this point I miss professional development tools.