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/Task3.cpp
- Revision:
- 40:27e344adfdb9
- Parent:
- 39:02782ad251db
- Child:
- 44:4be5c01c6de2
--- a/RTOS-Threads/src/Task3.cpp Wed May 14 12:42:39 2014 +0000
+++ b/RTOS-Threads/src/Task3.cpp Wed May 14 13:38:19 2014 +0000
@@ -64,14 +64,15 @@
/* Command decoder: */
inputYPR[0] = (RCCommand[0]-1500)*9/100*STICK_GAIN_YAW;
- inputYPR[1] = deadbandInputYPR((RCCommand[1]-1500)*-1*9/100*STICK_GAIN);
switch (mode) {
case RATE:
+ inputYPR[1] = deadbandInputYPR((RCCommand[1]-1500)*-1*9/100*STICK_GAIN);
inputYPR[2] = deadbandInputYPR((RCCommand[2]-1500)*9/100*STICK_GAIN);
break;
case ATTITUDE:
default:
- inputYPR[2] = deadbandInputYPR((RCCommand[2]-1500)*-1*9/100*STICK_GAIN);
+ inputYPR[1] = deadbandInputYPR((RCCommand[1]-1500)*-1*6/100*STICK_GAIN);
+ inputYPR[2] = deadbandInputYPR((RCCommand[2]-1500)*-1*6/100*STICK_GAIN);
break;
}
@@ -124,10 +125,10 @@
int constrainInputYPR(int input)
{
- if (input < -45)
- return -45;
- else if (input > 45)
- return 45;
+ if (input < -30)
+ return -30;
+ else if (input > 30)
+ return 30;
else
return input;
}