Problem using accelerometer (GY-81-3050) with I2C

Hi everyone,

I try to connect this accelerometer :

with an Arduino Uno (rev3) by i2c.
I have this scheme :

Accelerometer Arduino
VCC_IN 5V
GND GND
SCL A5
SDA A4

I use Arduino 1.0.5.

And the code which don't work is :

void setup()
{
  Serial.begin(115200, SERIAL_8N1); 
  Wire.begin();
}

void loop()
{
  int val = 0;
  Wire.beginTransmission(ADDR_ACCELEROMETER);
  Wire.write(0x02); // ACC_X 
  Wire.endTransmission();
  Wire.requestFrom(ADDR_ACCELEROMETER,1);
  val =  Wire.read();
  Wire.endTransmission(); // I try with and without this line
  Serial.print(val);
}

I try all i2c addresses for ADDR_ACCELEROMETER, but none of them work : val is always equal to 0xFF...

Have you got any suggestion/solution ?

Thanks !

OK, I think we have to use Wire.available() before Wire.read (that explain a part of my problem).

Then, a little code for the HMC5883 embedded in the GY-81-3050 :
https://www.sparkfun.com/tutorials/301