HMC5843

Hej,

I’m working on this sensor;
http://www.sparkfun.com/commerce/product_info.php?products_id=9371

There are the same project in this web side

http://eclecti.cc/hardware/hmc5843-magnetometer-library-for-arduino#comment-9938

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 (http://www.sparkfun.com/commerce/product_info.php?products_id=9371) should work perfectly, and you can load it onto an Arduino with the need of an AVR programmer. This tutorial: http://www.sparkfun.com/commerce/tutorial_info.php?tutorials_id=142, 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.

Hej,

First I started with the description in this web side

http://eclecti.cc/hardware/hmc5843-magnetometer-library-for-arduino ,

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()
{
Serial.begin(9600);
delay(5); // The HMC5843 needs 5ms before it will communicate
HMC.init();
}

void loop()
{
int x,y,z;
delay(1000);
HMC.getValues(&x,&y,&z);
Serial.print(“x:”);
Serial.print(x);
Serial.print(" y:");
Serial.print(y);
Serial.print(" z:");
Serial.println(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 “http://www.sparkfun.com/datasheets/Sensors/Magneto/HMC5843-v11.zip”. 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.

http://www.sparkfun.com/datasheets/Sensors/Magneto/HMC5843-v11.zip