ITG3200 library with multiple configurable full-scale ranges. Based on the Sensor_test by Bo Carøe.
Fork of ITG3200 by
Diff: ITG3200.h
- Revision:
- 1:1208ffc3ace9
- Parent:
- 0:a3a0caa8e802
- Child:
- 2:044664f2cc01
diff -r a3a0caa8e802 -r 1208ffc3ace9 ITG3200.h --- a/ITG3200.h Wed May 30 10:42:14 2012 +0000 +++ b/ITG3200.h Wed Aug 15 01:33:01 2012 +0000 @@ -1,10 +1,15 @@ #pragma once -//I2C Adresse, entweder 0x68 oder 0x69, abhaengig von Pin AD0 -#define ITG3200_ADRESS 0x68 +//I2C address is either 0x68 or 0x69 , depending on pin AD0, check block diagram for your device +#define ITG3200_ADRESS 0x69 -//Gyro-Rohdaten in Radiant pro Sekunde umrechnen -const float fConvRPS= 1.2141420883e-3; +//Convert gyro raw data to radians per second, 1 degree/s = 0,017453293 rad/s. +//The value is 0,017453293/LSB (+- 250 degrees/s) + +//const float fConvRPS= 2.6646248854961832061068702290076e-4; //For +- 500 degrees/s +//const float fConvRPS= 1.2141420883e-3; //For +- 2000 degrees/s + +const float fConvRPS= 1.3323124427480916030534351145038e-4; //For +- 250 degrees/s class ITG3200 { protected: @@ -15,24 +20,25 @@ //Offset float Offset[3]; - //Drehgeschwindigkeit um alle drei Achsen - short RawRate[3]; //Rohdaten - float Rate[3]; //kalibrierte Drehraten in Radiant pro Sekunde + //Rotational speed around all three axes + short RawRate[3]; //Raw data + float Rate[3]; //Calibrated rotation rate in radians per second - //Initialisieren + //Initialization ITG3200(I2C & I2CBus_, Timer & GlobalTime_); void Init(); private: - //Rohdaten lesen + //Read raw data void ReadRawData(); public: - //Update-Methode + //Update Method void Update(); + char getInfo(void); - //Kalibrieren + //Calibration void Calibrate(int ms); };