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 !