I purchased the HMC6343 compass and I am running the device with the Arduino Uno micro controller. Using one of the example programs I am able to successfully display the bearing, roll and pitch via the serial link .
The roll and pitch data match reality pretty well, but the compass bearing does not make any sense. I soldered the compass board to a micro SD shield board and aligned the Arduino, SD shield card stack with my workbench. I rotated the stack in 45 degree increments 360 degrees and I got these results:
start orientation = bearing 77.80 degrees
CCW rotation 45 = bearing 64.00 degrees (CCW = counter clockwise)
CCW rotation 90 = bearing 42.70 degrees
CCW rotation 135 = bearing 27.00 degrees
CCW rotation 180 = bearing 60.70 degrees
CCW rotation 225 = bearing 118.80 degrees
CCW rotation 270 = bearing 108.90 degrees
CCW rotation 315 = bearing 95.20 degrees
Naturally, I expect to see the bearing go from 0 - 360. I expect the device is hooked up correctly because the roll and pitch data are being reported correctly. Looking at the datasheet for the part the bearing is an unsigned 16 bit value while roll and pitch are 2’s complement signed values. I reviewed the library from Sparkfun and it looks like the library is handling the values the same way integers but I am no expert.
Please let me know if you have any experience with this part and if you have a suggestion for how I can fix the bearing data .