My fully self designed first stable working Quadrocopter Software.

Dependencies:   mbed

Dependents:   fluy343

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers IMU_10DOF.h Source File

IMU_10DOF.h

00001 // by MaEtUgR
00002 
00003 #ifndef IMU_10DOF_H
00004 #define IMU_10DOF_H
00005 
00006 #include "mbed.h"
00007 #include "L3G4200D.h"   // Gyro (Gyroscope)
00008 #include "ADXL345.h"    // Acc (Accelerometer)
00009 #include "HMC5883.h"    // Comp (Compass)
00010 #include "BMP085.h"     // Alt (Altitude sensor or Barometer)
00011 #include "MPU6050.h"    // Combined Gyroscope & Accelerometer
00012 #include "IMU_Filter.h" // Class to calculate position angles  (algorithm from S.O.H. Madgwick, see header file for info)
00013 //#include "MPU9250.h"    // Combined Gyroscope & Accelerometer & Magnetometer over SPI
00014 
00015 class IMU_10DOF
00016 {           
00017     public:
00018         IMU_10DOF(PinName sda, PinName scl);
00019         void readAngles();              // read all axis from register to array data
00020         void readAltitude();            // read all axis from register to array data
00021         
00022         float * angle;                  // where the measured and calculated data is saved
00023         float temperature;
00024         float pressure;
00025         float altitude;
00026         
00027         float dt;                       // time for entire loop
00028         float dt_sensors;               // time only to read sensors
00029         
00030         //MPU9250     mpu;                // All sensors Hardwaredrivers
00031         MPU6050     Sensor;
00032         L3G4200D    Gyro;
00033         ADXL345     Acc;
00034         HMC5883     Comp;
00035         BMP085      Alt;
00036             
00037     private:                            
00038         Timer LocalTimer;               // local time to calculate processing speed for entire loop and just reading sensors
00039         float time_for_dt;              // |
00040         float time_for_dt_sensors;      // |
00041         
00042         IMU_Filter  Filter;             // Filterclass to join sensor data
00043 };
00044 
00045 #endif