-#define TWI_FREQ 400000L
 #include <Wire.h>
 #include <L3G.h>
 #include <LSM303.h>

  gyro.writeReg(L3G_CTRL_REG1, 0xCF); // normal power mode, all axes enabled, 760 Hz
}

void Accel_Init()
{
  compass.init();
  compass.writeAccReg(LSM303_CTRL_REG1_A, 0x77); // normal power mode, all axes enabled, 400 Hz
}

void Compass_Init()
{
  compass.writeMagReg(LSM303_CRA_REG_M, 0x10); // 1C == 220 hz, 10 == 15 hz
  compass.writeMagReg(LSM303_CRB_REG_M, 0x20); // Lowest gain
  compass.writeMagReg(LSM303_MR_REG_M, 0x00); // continuous conversion mode
}


void setup()
{ 
  I2C_Init();
  Compass_Init();
  Gyro_Init();
  
