lib para o framework sgam

Dependencies:   MPU6050 Grove_temperature

Dependents:   example_smart-grid

peripheral/impl/Gyroscope.h

Committer:
AndersonIctus
Date:
2019-06-02
Revision:
3:f998244e9f80
Child:
4:f21aab30658a

File content as of revision 3:f998244e9f80:

#ifndef SGAM_GYROSCOPE_H
#define SGAM_GYROSCOPE_H

#include "mbed.h"
#include "Sensor.h"
#include "MPU6050.h"

typedef struct {
    int16_t ax, ay, az;
    int16_t gx, gy, gz;
} GyroscopeData;

class Gyroscope: public Sensor<GyroscopeData> {
public:
    Gyroscope(I2C i2c);
    virtual ~Gyroscope();

    virtual GyroscopeData* getValue();
    virtual void readOcurred( void* (*callBack)(GyroscopeData* value), float timeout);

private:
    MPU6050 mpu;
    GyroscopeData value;

    void getMotion(GyroscopeData* data);
};

#endif // SGAM_GYROSCOPE_H