lib para o framework sgam

Dependencies:   MPU6050 Grove_temperature

Dependents:   example_smart-grid

Committer:
AndersonIctus
Date:
Sun Jun 02 16:51:13 2019 -0300
Revision:
3:f998244e9f80
Child:
4:f21aab30658a
- Inclusao dos Arquivos para o GIROSCOPIO !!

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AndersonIctus 3:f998244e9f80 1 #ifndef SGAM_GYROSCOPE_H
AndersonIctus 3:f998244e9f80 2 #define SGAM_GYROSCOPE_H
AndersonIctus 3:f998244e9f80 3
AndersonIctus 3:f998244e9f80 4 #include "mbed.h"
AndersonIctus 3:f998244e9f80 5 #include "Sensor.h"
AndersonIctus 3:f998244e9f80 6 #include "MPU6050.h"
AndersonIctus 3:f998244e9f80 7
AndersonIctus 3:f998244e9f80 8 typedef struct {
AndersonIctus 3:f998244e9f80 9 int16_t ax, ay, az;
AndersonIctus 3:f998244e9f80 10 int16_t gx, gy, gz;
AndersonIctus 3:f998244e9f80 11 } GyroscopeData;
AndersonIctus 3:f998244e9f80 12
AndersonIctus 3:f998244e9f80 13 class Gyroscope: public Sensor<GyroscopeData> {
AndersonIctus 3:f998244e9f80 14 public:
AndersonIctus 3:f998244e9f80 15 Gyroscope(I2C i2c);
AndersonIctus 3:f998244e9f80 16 virtual ~Gyroscope();
AndersonIctus 3:f998244e9f80 17
AndersonIctus 3:f998244e9f80 18 virtual GyroscopeData* getValue();
AndersonIctus 3:f998244e9f80 19 virtual void readOcurred( void* (*callBack)(GyroscopeData* value), float timeout);
AndersonIctus 3:f998244e9f80 20
AndersonIctus 3:f998244e9f80 21 private:
AndersonIctus 3:f998244e9f80 22 MPU6050 mpu;
AndersonIctus 3:f998244e9f80 23 GyroscopeData value;
AndersonIctus 3:f998244e9f80 24
AndersonIctus 3:f998244e9f80 25 void getMotion(GyroscopeData* data);
AndersonIctus 3:f998244e9f80 26 };
AndersonIctus 3:f998244e9f80 27
AndersonIctus 3:f998244e9f80 28 #endif // SGAM_GYROSCOPE_H