ITG3200 library with multiple configurable full-scale ranges. Based on the Sensor_test by Bo Carøe.

Dependents:   KalmanFilter

Fork of ITG3200 by Claudio Donate

ITG3200.h

Committer:
caroe
Date:
2012-05-30
Revision:
0:a3a0caa8e802
Child:
1:1208ffc3ace9

File content as of revision 0:a3a0caa8e802:

#pragma once

//I2C Adresse, entweder 0x68 oder 0x69, abhaengig von Pin AD0
#define ITG3200_ADRESS 0x68

//Gyro-Rohdaten in Radiant pro Sekunde umrechnen
const float fConvRPS= 1.2141420883e-3;

class ITG3200 {
protected:
    I2C & I2CBus;
    Timer & GlobalTime;

public:
    //Offset
    float Offset[3];

    //Drehgeschwindigkeit um alle drei Achsen
    short RawRate[3];       //Rohdaten
    float Rate[3];          //kalibrierte Drehraten in Radiant pro Sekunde


    //Initialisieren
    ITG3200(I2C & I2CBus_, Timer & GlobalTime_);
    void Init();


private:
    //Rohdaten lesen
    void ReadRawData();

public:
    //Update-Methode
    void Update();

    //Kalibrieren
    void Calibrate(int ms);
};