I2C and Gyro ITG-3200

Hello,

Im working on a 9DOF project and wonder how I can initial the ITG-3200 with the Wire library. This is a 3 axis digital gyroscope which is a simple I2C interface.

What shold I be looking for in the data sheet to start an I2C device with wire?

This is my code:

void Gyro_Init()
{
  Wire.beginTransmission(GyroAddress);
  Wire.send(?); 
  Wire.send(?);
  Wire.endTransmission();
}

the register map is located here: http://www.eboy.no/extra/register.png

You need more than just the register map you need to know what those bits mean.
Look at the device’s data sheet that normally tells you what to write.

Post the datasheet for the gyro.

Hello,

I found it out. It is a very fast device, ±2000 degrees/s! I recommend it to everybody ;)

void Gyro_Init()
{
  Wire.beginTransmission(GyroAddress);
  Wire.send(0x3E);
  Wire.send(0x80);  //send a reset to the device
  Wire.endTransmission(); //end transmission
  
  Wire.beginTransmission(GyroAddress);
  Wire.send(0x15);
  Wire.send(0x00);   //sample rate divider
  Wire.endTransmission(); //end transmission
  
  Wire.beginTransmission(GyroAddress);
  Wire.send(0x16); 
  Wire.send(0x18); // ±2000 degrees/s (default value)
  Wire.endTransmission(); //end transmission
  
  Wire.beginTransmission(GyroAddress);
  Wire.send(0x17);
  Wire.send(0x05);   // enable send raw values
  Wire.endTransmission(); //end transmission
}

So is this working now or do you still have a problem?

@Grumpy_Mike

Its working very well! I got temperature and gyro (xyz) output ;)

I am very interested in this gyro, I hope I buy one too for my arduino :)

Hi Eboy,

Can u post the full code for reading the gyro values? I have problems reading the values. It would be very helpful to me.

Hi,

I'm writing a lib for ITG-3200 that may be of some use for you. Its still very beta but may help.

You may download it at:

code.google.com/p/itg-3200driver/

Regards, Flipo