I’m working on this sensor;

There are the same project in this web side

But it dose not work , I send a email to sparkfun about this problem , this is the replay;

Hello,I’m very sorry to hear about the trouble this sensor is giving you. The example code we’ve posted on the product page ( should work perfectly, and you can load it onto an Arduino with the need of an AVR programmer. This tutorial:, in the ‘Serial bootloading an Arduino board’ section describes how you can load the code using WinAVR.

There have been discussions of an incorrect capacitor on the board, but our tests show that the board does work with the current setup.

Hope that helps. Let me know if you have any further questions or concerns.

is there any one can help me :-/

I want just get X,Y,Z of the magnetic filed. How!!!

My items;
1.Arduino ATMEGA 328
2.logic level converte
3.HMC5843 sensor

....But it dose not work....

you are going to need to be more specific than that.

is it an i2c communication error? power problem? hardware issue? wiring issue? etc.


First I started with the description in this web side ,

But I had a problem in the results, the result change automatically even when I try to effect the sensor with the magnetic item as move it around the sensor its not change any thing, the results like:

x:4128 y:256 z:8192
x:5119 y:-1 z:-1
x:4128 y:256 z:8192
x:4128 y:256 z:8192
x:4128 y:256 z:8192
x:4128 y:256 z:8256
x:4128 y:256 z:8192
x:4129 y:-1 z:-1
x:4128 y:256 z:8192
x:4128 y:256 z:8192
x:4128 y:256 z:8192

This is the program that run in arduino

#include <HMC.h>

void setup()
delay(5); // The HMC5843 needs 5ms before it will communicate

void loop()
int x,y,z;
Serial.print(" y:");
Serial.print(" z:");

So after all, I sent a email to Sparkfun and I get this email, My question is if I try to use the code (I think I have put these files under hardware/libraries/ folder of my Arduino directory) in this link “”. To get the right X,Y,X valve what is the code that I will use in Arduino , like;

#include <defs.h>
#include <i2c.h>
#include <types.h>

void setup(){


void loop(){


To narrow the problem, how can I compile the C code i got from Sparkfun and send it to my Arduino board? Im assuming that I dont use the Arduino programming environment.