Clément BENOIT / PYRN

Dependencies:   CAN HTTPClient MODSERIAL MyThings Pyrn3GModem Socket TinyGPS MyUSBHost lwip-sys lwip mbed-rtos mbed-src

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers IMUSensor.h Source File

IMUSensor.h

00001 #ifndef IMU_SENSOR_H
00002 #define IMU_SENSOR_H
00003 
00004 #include "mbed.h"
00005 #include "MySensor.h"
00006 #include "LSM303DLH.h"
00007 
00008 #define IMU_STORE_SIZE      128
00009 
00010 class IMUSensor: public MySensor {
00011 protected:
00012     uint16_t store[IMU_STORE_SIZE];
00013     typedef struct _imuImpact{
00014         int16_t ax;
00015         int16_t ay;
00016         int16_t az;
00017         int16_t mx;
00018         int16_t my;
00019         int16_t mz;
00020     }  __attribute__((packed)) imuImpact;
00021     imuImpact   impact;
00022     LSM303DLH   Accelerometer;
00023 public:
00024     IMUSensor(PinName sda, PinName scl, uint32_t idle = 1000);
00025     virtual void InitResultsStatic(void);
00026     virtual void Loop(void);
00027     virtual void StoreLastImpact(void);
00028 };
00029 
00030 #endif // IMU_SENSOR_H