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/src/Task2.cpp
- Revision:
- 5:4879ef0e6d41
- Parent:
- 3:605fbcb54e75
- Child:
- 7:3d28cfc4901b
diff -r 01921a136f58 -r 4879ef0e6d41 RTOS-Threads/src/Task2.cpp --- a/RTOS-Threads/src/Task2.cpp Wed Apr 30 06:37:42 2014 +0000 +++ b/RTOS-Threads/src/Task2.cpp Wed Apr 30 07:13:11 2014 +0000 @@ -12,22 +12,26 @@ void Task2(void const *argument) { - yawPIDrate.setSetPoint(RCCommand[0]); - pitchPIDrate.setSetPoint(RCCommand[1]); - rollPIDrate.setSetPoint(RCCommand[2]); - + yawPIDrate.setSetPoint((RCCommand[0]-1500)*9/10); + pitchPIDrate.setSetPoint((RCCommand[1]-1500)*-1*9/10); + rollPIDrate.setSetPoint((RCCommand[2]-1500)*9/10); + imu.getRotation(&gx, &gy, &gz); gx /= 32.8; + gx += 2; gy /= 32.8; gz /= 32.8; - + + if (gyro_out) + BT.printf("%4d %4d %4d\n", gx, gy, gz); + yawPIDrate.setProcessValue(gz); pitchPIDrate.setProcessValue(gy); - rollPIDrate.setProcessValue(gz); - + rollPIDrate.setProcessValue(gx); + yaw_adjust = yawPIDrate.compute(); pitch_adjust = pitchPIDrate.compute(); roll_adjust = rollPIDrate.compute(); - + //LED[2] = !LED[2]; } \ No newline at end of file