Ian Hua / Quadcopter-mbedRTOS
Committer:
pHysiX
Date:
Thu May 08 09:39:12 2014 +0000
Revision:
21:b642c18eccd1
Parent:
20:b193a50a2ba3
Child:
22:ef8aa9728013
Primary PID disabled. Secondary (rate) PID enabled. P gain tuned

Who changed what in which revision?

UserRevisionLine numberNew contents of line
pHysiX 1:43f8ac7ca6d7 1 #include "mbed.h"
pHysiX 1:43f8ac7ca6d7 2 #include "rtos.h"
pHysiX 1:43f8ac7ca6d7 3 #include "tasks.h"
pHysiX 1:43f8ac7ca6d7 4
pHysiX 1:43f8ac7ca6d7 5 #ifndef _TASK2_H_
pHysiX 1:43f8ac7ca6d7 6 #define _TASK2_H_
pHysiX 1:43f8ac7ca6d7 7
pHysiX 20:b193a50a2ba3 8 // ms
pHysiX 1:43f8ac7ca6d7 9 #define TASK2_PERIOD 1000/TASK2_FREQUENCY
pHysiX 1:43f8ac7ca6d7 10
pHysiX 21:b642c18eccd1 11 extern volatile float adjust[3];
pHysiX 21:b642c18eccd1 12
pHysiX 21:b642c18eccd1 13 extern volatile int gyro[3];
pHysiX 3:605fbcb54e75 14
pHysiX 10:ef5fe86f67fe 15 extern bool counterESC;
pHysiX 10:ef5fe86f67fe 16
pHysiX 12:953d25061417 17 /* Gyro & PID */
pHysiX 1:43f8ac7ca6d7 18 void Task2(void const *argument);
pHysiX 1:43f8ac7ca6d7 19
pHysiX 1:43f8ac7ca6d7 20 #endif
pHysiX 21:b642c18eccd1 21
pHysiX 21:b642c18eccd1 22 /*} else {
pHysiX 21:b642c18eccd1 23 yawPIDrate.setSetPoint(0);
pHysiX 21:b642c18eccd1 24 pitchPIDrate.setSetPoint(0);
pHysiX 21:b642c18eccd1 25 rollPIDrate.setSetPoint(0);
pHysiX 21:b642c18eccd1 26
pHysiX 21:b642c18eccd1 27 yawPIDrate.setProcessValue(gyro[2]);
pHysiX 21:b642c18eccd1 28 pitchPIDrate.setProcessValue(gyro[1]);
pHysiX 21:b642c18eccd1 29 rollPIDrate.setProcessValue(gyro[0]);
pHysiX 21:b642c18eccd1 30
pHysiX 21:b642c18eccd1 31 adjust[0] = yawPIDrate.compute();
pHysiX 21:b642c18eccd1 32 adjust[1] = pitchPIDrate.compute();
pHysiX 21:b642c18eccd1 33 adjust[2] = rollPIDrate.compute();
pHysiX 21:b642c18eccd1 34 }*/
pHysiX 21:b642c18eccd1 35