Hello here,
I'm new here from France and currently using Arduino for building a hobby robot.
I bought an Arduino Uno and a IMU 6dof ( http://www.drotek.fr/shop/en/32-imu-6dof-itg3200-gyro-bma180-accelerometer-sensor.html ) to merge a BMA180 (3 axes Accelerometer) and a ITG3200 (3axes Gyro).
I'm using a Logic Level Converter BOB-08745 to adapt the 5V I2C from the Arduino Uno into the 3.3V I2C of the IMU.
My problem is: I'm successfully exchanging data with the ITG3200 but the BMA play dead.
In order to figure out I try a very simple code which print the ID of both sensors :
#include <Wire.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup(void) {
uint8_t result1, result2;
lcd.begin(16, 2);
Wire.begin();
delay(1000);
// GYRO
Wire.beginTransmission(0x69);
Wire.write(0x00);
Wire.endTransmission();
Wire.beginTransmission(0x69);
Wire.requestFrom(0x69, 2);
if (Wire.available()==2)
{
result1 = Wire.read();
result2 = Wire.read();
}
else result1=0;
Wire.endTransmission();
lcd.print("ITG Id ");
lcd.print(result1);
lcd.print(" v.");
lcd.print(result2);
delay(1000);
// ACCEL
Wire.beginTransmission(0x40);
Wire.write(0x00);
Wire.endTransmission();
Wire.beginTransmission(0x40);
Wire.requestFrom(0x40, 2);
if (Wire.available()==2)
{
result1 = Wire.read();
result2= Wire.read();
}
else
{
result1=0;
result2=255;
}
Wire.endTransmission();
lcd.setCursor(0, 1);
lcd.print("BMA Id ");
lcd.print(result1);
lcd.print(" v.");
lcd.print(result2);
delay(1000);
// GYRO
Wire.beginTransmission(0x69);
Wire.write(0x00);
Wire.endTransmission();
Wire.beginTransmission(0x69);
Wire.requestFrom(0x69, 2);
if (Wire.available()==2)
{
result1 = Wire.read();
result2 = Wire.read();
}
else result1=0;
Wire.endTransmission();
lcd.setCursor(0, 0);
lcd.print("ITG Id ");
lcd.print(result1);
lcd.print(" v.");
lcd.print(result2);
}
void loop(void) {
}
On this code :
- the ITG return an ID of 105 and a version of 78.
- but the BMA has 0 returning by the function Wire.available()!
No matter which one I try to contact first.
Does someone has an idea on what could be turning bad?
Thanks a lot in advance
Best regards
