Rev 2052 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2048 | - | 1 | #include <inttypes.h> |
2 | #include "controlMixer.h" |
||
3 | #include "attitude.h" |
||
4 | #include <stdlib.h> |
||
5 | |||
6 | // The only possibility in a compass control is to aim the head at some compass heading. |
||
7 | // One way could be: When a switch is turned on, we capture the current heading in a variable. |
||
8 | // From then on, if the current heading is to the right of the captured heading, we yaw left etc. |
||
9 | // If the yaw at input is nonzero, we could also temporarily disable this and instead re-capture |
||
10 | // the current heading.. |
||
11 | |||
12 | int32_t magneticTargetHeading; |
||
13 | |||
14 | void CC_periodicTaskAndPRTY(int16_t* PRTY) { |
||
15 | int16_t currentYaw = PRTY[CONTROL_YAW]; |
||
16 | if (abs(currentYaw) < 10) { |
||
17 | magneticTargetHeading = magneticHeading; |
||
18 | } |
||
19 | } |