Ian Hua / Quadcopter-mbedRTOS
Committer:
pHysiX
Date:
Fri May 02 17:19:00 2014 +0000
Revision:
14:267368c83b6a
Parent:
12:953d25061417
Child:
20:b193a50a2ba3
Reduced ESC pulse frequency to 200Hz from 400Hz since control is run up to 200Hz

Who changed what in which revision?

UserRevisionLine numberNew contents of line
pHysiX 1:43f8ac7ca6d7 1 #include "mbed.h"
pHysiX 1:43f8ac7ca6d7 2 #include "MPU6050_6Axis_MotionApps20.h"
pHysiX 3:605fbcb54e75 3 #include "PID.h"
pHysiX 12:953d25061417 4 #include "MPL3115A2.h"
pHysiX 12:953d25061417 5
pHysiX 12:953d25061417 6 #ifdef ENABLE_COMPASS
pHysiX 12:953d25061417 7 #include "HMC5883L.h"
pHysiX 12:953d25061417 8 #endif
pHysiX 1:43f8ac7ca6d7 9
pHysiX 1:43f8ac7ca6d7 10 #ifndef _SETUP_H_
pHysiX 1:43f8ac7ca6d7 11 #define _SETUP_H_
pHysiX 1:43f8ac7ca6d7 12
pHysiX 4:01921a136f58 13 #define KP_YAW_RATE 1.0
pHysiX 4:01921a136f58 14 #define KP_PITCH_RATE 1.0
pHysiX 4:01921a136f58 15 #define KP_ROLL_RATE 1.0
pHysiX 4:01921a136f58 16
pHysiX 14:267368c83b6a 17 #define ESC_FREQUENCY 200
pHysiX 2:ab967d7b4346 18 #define ESC_PERIOD_US 1000000/ESC_FREQUENCY
pHysiX 2:ab967d7b4346 19
pHysiX 1:43f8ac7ca6d7 20 extern Serial BT;
pHysiX 1:43f8ac7ca6d7 21 extern DigitalOut BT_CMD;
pHysiX 1:43f8ac7ca6d7 22
pHysiX 1:43f8ac7ca6d7 23 extern MPU6050 imu;
pHysiX 1:43f8ac7ca6d7 24 extern uint16_t packetSize;
pHysiX 1:43f8ac7ca6d7 25
pHysiX 12:953d25061417 26 #ifdef ENABLE_COMPASS
pHysiX 12:953d25061417 27 extern HMC5883L compass;
pHysiX 12:953d25061417 28 #endif
pHysiX 12:953d25061417 29
pHysiX 12:953d25061417 30 extern MPL3115A2 altimeter;
pHysiX 12:953d25061417 31
pHysiX 3:605fbcb54e75 32 //extern DigitalOut LED[];
pHysiX 3:605fbcb54e75 33
pHysiX 3:605fbcb54e75 34 extern PID yawPIDrate;
pHysiX 3:605fbcb54e75 35 extern PID pitchPIDrate;
pHysiX 3:605fbcb54e75 36 extern PID rollPIDrate;
pHysiX 1:43f8ac7ca6d7 37
pHysiX 3:605fbcb54e75 38 extern PwmOut ESC[4];
pHysiX 2:ab967d7b4346 39
pHysiX 3:605fbcb54e75 40 bool setupALLdevices(void);
pHysiX 2:ab967d7b4346 41 bool setup_ESC(void);
pHysiX 1:43f8ac7ca6d7 42 bool setup_bt(void);
pHysiX 3:605fbcb54e75 43 bool setup_PID(void);
pHysiX 1:43f8ac7ca6d7 44 bool setup_mpu6050(void);
pHysiX 12:953d25061417 45 #ifdef ENABLE_COMPASS
pHysiX 12:953d25061417 46 bool setup_compass(void);
pHysiX 12:953d25061417 47 #endif
pHysiX 12:953d25061417 48 bool setup_altimeter(void);
pHysiX 1:43f8ac7ca6d7 49
pHysiX 1:43f8ac7ca6d7 50 #endif