Anderson Cunha / sgam_mdw_NUCLEOF429ZI_impl

Dependencies:   MPU6050 Grove_temperature

Dependents:   sgam_mdw_test

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Gyroscope.h Source File

Gyroscope.h

00001 #ifndef SGAM_MDW_SENSOR_GYROSCOPE_H
00002 #define SGAM_MDW_SENSOR_GYROSCOPE_H
00003 
00004 #include "sgam_mdw.h"
00005 #include "mbed.h"
00006 #include "MPU6050.h"
00007 
00008 class GyroscopeData {
00009 public:
00010     int16_t ax, ay, az;
00011     int16_t gx, gy, gz;
00012 
00013     GyroscopeData(){}
00014     ~GyroscopeData(){}
00015 };
00016 
00017 class Gyroscope: public Sensor<GyroscopeData> {
00018 public:
00019     Gyroscope(I2C &i2c);
00020     virtual ~Gyroscope();
00021 
00022     virtual int initialize();
00023     virtual int finalize();
00024 
00025     virtual GyroscopeData* getValue();
00026     virtual const char* getName();
00027 
00028 private:
00029     MPU6050 mpu;    
00030     void getMotion(GyroscopeData* data);
00031 };
00032 
00033 #endif // SGAM_MDW_SENSOR_GYROSCOPE_H