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.
RTOS-Threads/src/Task4.cpp
- Committer:
- pHysiX
- Date:
- 2014-04-29
- Revision:
- 3:605fbcb54e75
- Parent:
- 2:ab967d7b4346
- Child:
- 5:4879ef0e6d41
File content as of revision 3:605fbcb54e75:
/* Update ESC */ /* 200Hz <= PWM frequency <= 400Hz */ #include "tasks.h" #include "setup.h" int ESCpower[4] = {0, 0, 0, 0}; void Task4(void const *argurment) { /* [YAW PITCH ROLL THROTTLE AUX] */ ESCpower[0] = RCCommand[3] + (pitch_adjust / 2) - (roll_adjust / 2) + (yaw_adjust / 2); ESCpower[1] = RCCommand[3] + (pitch_adjust / 2) + (roll_adjust / 2) - (yaw_adjust / 2); ESCpower[2] = RCCommand[3] - (pitch_adjust / 2) + (roll_adjust / 2) + (yaw_adjust / 2); ESCpower[3] = RCCommand[3] - (pitch_adjust / 2) - (roll_adjust / 2) - (yaw_adjust / 2); //BT.printf("%4d %4d %4d %4d\n", ESCpower[0], ESCpower[1], ESCpower[2], ESCpower[3]); for (int i = 0; i < 4; i++) ESC[i].pulsewidth_us(ESCpower[i]); //LED[4] = !LED[4]; }