José Claudio
/
ReadingGyro_ITG3205
Example of reading an gyroscope sensor (ITG3205)
Diff: Gyroscope.h
- Revision:
- 0:d884c7453c85
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Gyroscope.h Tue May 21 13:50:20 2013 +0000 @@ -0,0 +1,50 @@ +#ifndef GYROSCOPE_H +#define GYROSCOPE_H + +#include "ITG3205.h" + +#define PI 3.14159265 + +class Gyroscope +{ + public: + Gyroscope(ITG3205* gyroHardware, float sensitivity, float dataRate); + ~Gyroscope(void); + + void updateZeroRates(); + + void update(); + void update(int samplesSize, int sampleDataRate); + + void resetAngles(); + + float getRadiansX(); + float getRadiansY(); + float getRadiansZ(); + + float getDegreesX(); + float getDegreesY(); + float getDegreesZ(); + + float getAngleX(); + float getAngleY(); + float getAngleZ(); + + private: + ITG3205* gyroHardware; + + float sensitivity; + float dataRate; + + float zeroRateX, zeroRateY, zeroRateZ; + + float rawX; + float rawY; + float rawZ; + + float angleX; + float angleY; + float angleZ; +}; + +#endif /* GYROSCOPE_H */