Successful acro and level mode now! Relying on MPU9250 as base sensor. I'm working continuously on tuning and features :) NEWEST VERSION ON: https://github.com/MaEtUgR/FlyBed (CODE 100% compatible/copyable)

Dependencies:   mbed

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 "MPU9250.h"    // Combined Gyroscope & Accelerometer & Magnetometer over SPI
00008 #include "MPU6050.h"    // Combined Gyroscope & Accelerometer
00009 #include "IMU_Filter.h" // Class to calculate position angles  (algorithm from S.O.H. Madgwick, see header file for info)
00010 
00011 class IMU_10DOF
00012 {           
00013     public:
00014         IMU_10DOF(PinName MOSI, PinName MISO, PinName SCLK, PinName CS, PinName SDA, PinName SCL);
00015         void readAngles();              // read all sensors and calculate angles
00016         
00017         float * angle;                  // where the measured and calculated data is saved
00018         float temperature;
00019         float pressure;
00020         float altitude;
00021         
00022         float dt;                       // time for entire loop
00023         float dt_sensors;               // time only to read sensors
00024         
00025         MPU9250     mpu;                // The sensor Hardware Driver
00026         MPU6050     mpu2;
00027             
00028     private:                            
00029         Timer LoopTimer;               // local time to calculate processing speed for entire loop
00030         Timer SensorTimer;             // local time to calculate processing speed for just reading sensors
00031         
00032         IMU_Filter  Filter;             // Filterclass to join sensor data
00033 };
00034 
00035 #endif