Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: RTOS-Threads/inc/Task2.h
- Revision:
- 22:ef8aa9728013
- Parent:
- 21:b642c18eccd1
diff -r b642c18eccd1 -r ef8aa9728013 RTOS-Threads/inc/Task2.h --- a/RTOS-Threads/inc/Task2.h Thu May 08 09:39:12 2014 +0000 +++ b/RTOS-Threads/inc/Task2.h Thu May 08 10:33:43 2014 +0000 @@ -1,3 +1,10 @@ +/* File: Task2.h + * Author: Trung Tin Ian HUA + * Date: May 2014 + * Purpose: Thread2: Gyro sample and PID Control loop + * Settings: 200Hz + */ + #include "mbed.h" #include "rtos.h" #include "tasks.h" @@ -5,31 +12,14 @@ #ifndef _TASK2_H_ #define _TASK2_H_ -// ms +// ms timing: Refer to tasks.h to change frequency of Task2. #define TASK2_PERIOD 1000/TASK2_FREQUENCY extern volatile float adjust[3]; - extern volatile int gyro[3]; - extern bool counterESC; -/* Gyro & PID */ +/* Thread2: Gyro Sample & PID Computation */ void Task2(void const *argument); #endif - -/*} else { - yawPIDrate.setSetPoint(0); - pitchPIDrate.setSetPoint(0); - rollPIDrate.setSetPoint(0); - - yawPIDrate.setProcessValue(gyro[2]); - pitchPIDrate.setProcessValue(gyro[1]); - rollPIDrate.setProcessValue(gyro[0]); - - adjust[0] = yawPIDrate.compute(); - adjust[1] = pitchPIDrate.compute(); - adjust[2] = rollPIDrate.compute(); -}*/ -