IMU01a

I am trying to get the data from the sensors (magnetometer in the exemple below) to an arduino uno
It Serial.print (zeros) 000000000000000…

electric cable:
A5 in SCL , A4 in SDA, 5 in vin, ground in ground

#include <Wire.h>
int Xlow = 0;
int Xhigh = 0;
int axeX = 0;


void setup()
{
  Wire.begin(); // join i2c bus (address magnetometre)
  Serial.begin(9600);
}


void loop()
{
  Wire.beginTransmission(B0011110); //(address magnetometre)
  Xlow = Wire.requestFrom(0x03,8); // adresse axe X Low magnetometre
  Xhigh = Wire.requestFrom(0x04,8); // adresse axe X High magnetometre
  Wire.endTransmission();
  axeX = Xlow << 8 | Xhigh;
  Serial.println( axeX );
  delay(50);
}

Thanks for your help

Hello.

I am sorry you are having trouble using that magnetometer. Can you try using our LSM303 Arduino library to see if it is working? If so, you can probably just review the differences between your code and our library to get an idea for how to communicate with the magnetometer.

-Jon