Go Down

Topic: HMC5883L compass huge error [SOLVED] (Read 34245 times) previous topic - next topic


I understand.  But when you tilt it a little from level the X mag value does not change, of course.
When you first tilt it 15 deg towards N, then back and forth another 15, the Y,Z do not change.
Only the orientation values change in this case.
Will see if your code handles this.
Reading the source looks great!


While on the topic of this magnetometer, I have a Processing sketch that plots the x/y/z/heading and Bt.  I'm using scaled values to determin my heading and getting pretty good results.

My problem is that I'm using Serial.write() to send the signed integers to Processing.  Since each axis has two registers, and sends 2 bytes, I'm getting mixed values on the Processing end. 
How do I go about sending each axis MSB and LSB,  and then join the two once they are read in Processing?  I have searched forums and reference pages for days, and have not made
any progress.  I am storing the incoming bytes into an array in processing.  Any help would be appreciated.

Also, the good results I am getting are via the HMC5883L library instead of calling addresses on the I2C directly.  I'm allowing the library to do the heavy lifting.  Thanks in advance for
any assistance


Please don't cross-post.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

Go Up