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

IMU/IMU_10DOF.h

Committer:
maetugr
Date:
2015-09-14
Revision:
7:90f876d47862
Parent:
0:37f0c1e8fa66
Child:
8:609a2ad4c30e

File content as of revision 7:90f876d47862:

// by MaEtUgR

#ifndef IMU_10DOF_H
#define IMU_10DOF_H

#include "mbed.h"
#include "MPU9250.h"    // Combined Gyroscope & Accelerometer & Magnetometer over SPI
#include "IMU_Filter.h" // Class to calculate position angles  (algorithm from S.O.H. Madgwick, see header file for info)

class IMU_10DOF
{           
    public:
        IMU_10DOF(PinName MOSI, PinName MISO, PinName SCLK, PinName CS);
        void readAngles();              // read all sensors and calculate angles
        
        float * angle;                  // where the measured and calculated data is saved
        float temperature;
        float pressure;
        float altitude;
        
        float dt;                       // time for entire loop
        float dt_sensors;               // time only to read sensors
        
        MPU9250     mpu;                // The sensor Hardware Driver
            
    private:                            
        Timer LoopTimer;               // local time to calculate processing speed for entire loop
        Timer SensorTimer;             // local time to calculate processing speed for just reading sensors
        
        IMU_Filter  Filter;             // Filterclass to join sensor data
};

#endif