Code for our FYDP -only one IMU works right now -RTOS is working

Dependencies:   mbed

Committer:
majik
Date:
Wed Mar 18 22:23:48 2015 +0000
Revision:
0:964eb6a2ef00
This is our FYDP code, but only one IMU works with the RTOS.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
majik 0:964eb6a2ef00 1 #ifndef DMP_H
majik 0:964eb6a2ef00 2 #define DMP_H
majik 0:964eb6a2ef00 3
majik 0:964eb6a2ef00 4 #include "MPU6050_6Axis_MotionApps20.h"
majik 0:964eb6a2ef00 5 #include "IMUDATA.h"
majik 0:964eb6a2ef00 6 #include "robot.h"
majik 0:964eb6a2ef00 7
majik 0:964eb6a2ef00 8 #define PRINT_GYR //uncomment this to print gyro data
majik 0:964eb6a2ef00 9 //#define PRINT_ACC //uncomment this to print accel data
majik 0:964eb6a2ef00 10
majik 0:964eb6a2ef00 11 #define PI 3.1415926
majik 0:964eb6a2ef00 12
majik 0:964eb6a2ef00 13 #define DMP_RESET_PIN IMU_RESET_PIN
majik 0:964eb6a2ef00 14 #define DMP_SDA_PIN IMU_SDA_PIN
majik 0:964eb6a2ef00 15 #define DMP_NOTUSED_PIN IMU_NOTUSED_PIN
majik 0:964eb6a2ef00 16 #define MPU_LED_ON LED_ON
majik 0:964eb6a2ef00 17 #define MPU_LED_OFF LED_OFF
majik 0:964eb6a2ef00 18
majik 0:964eb6a2ef00 19 #define DMP_DBG_MSG(...) //bt.printf(__VA_ARGS__); //uncomment this to print debug messages
majik 0:964eb6a2ef00 20
majik 0:964eb6a2ef00 21 #define RESET_BAUD_RATE bt.baud(BT_BAUD_RATE);
majik 0:964eb6a2ef00 22
majik 0:964eb6a2ef00 23 extern volatile bool mpuInterrupt; //indicates whether interrupt pin has gone high
majik 0:964eb6a2ef00 24 extern uint16_t packetSize; // expected DMP packet size (default is 42 bytes)
majik 0:964eb6a2ef00 25 extern uint16_t fifoCount; // count of all bytes currently in FIFO
majik 0:964eb6a2ef00 26
majik 0:964eb6a2ef00 27 int test_dmp();
majik 0:964eb6a2ef00 28 int test_dmp2();
majik 0:964eb6a2ef00 29 void start_dmp(MPU6050 mpu1); //this will get the DMP ready
majik 0:964eb6a2ef00 30 void start_dmp2(MPU6051 mpu1); //this will get the DMP ready
majik 0:964eb6a2ef00 31 void update_dmp(); //call this frequently
majik 0:964eb6a2ef00 32 void update_dmp2(); //call this frequently
majik 0:964eb6a2ef00 33 void update_yaw(MPU6050); //this only updates yaw
majik 0:964eb6a2ef00 34 void update_acc(); //this only updates the acceleration
majik 0:964eb6a2ef00 35 void calibrate_1();
majik 0:964eb6a2ef00 36 void calibrate_optFlow();
majik 0:964eb6a2ef00 37
majik 0:964eb6a2ef00 38
majik 0:964eb6a2ef00 39 #endif