A library used for controlling a quadcopter. It provides an easy to use interface, which allows to mount, calibrate and run motors. It is also able to calibrate the actual speed according to calculated PID roll & pitch difference. I used the original Servo library as ESC modules use the same PWM signal as Servo motors.
Diff: Quadcopter.cpp
- Revision:
- 2:62e387f1d095
- Parent:
- 1:cadf589cab2f
- Child:
- 3:84d246dccb8d
diff -r cadf589cab2f -r 62e387f1d095 Quadcopter.cpp --- a/Quadcopter.cpp Thu Feb 19 00:15:36 2015 +0000 +++ b/Quadcopter.cpp Thu Feb 19 12:19:17 2015 +0000 @@ -30,6 +30,11 @@ actSpeed[1] = speed[1] - (rollDiff / 2) + (pitchDiff / 2); actSpeed[2] = speed[2] + (rollDiff / 2) - (pitchDiff / 2); actSpeed[3] = speed[3] - (rollDiff / 2) - (pitchDiff / 2); + +// actSpeed[0] = speed[0] + (rollDiff / 2) + (pitchDiff / 2); +// actSpeed[1] = speed[1] - (rollDiff / 2) + (pitchDiff / 2); +// actSpeed[2] = speed[2] + (rollDiff / 2) - (pitchDiff / 2); +// actSpeed[3] = speed[3] - (rollDiff / 2) - (pitchDiff / 2); } //-----------------------Function for producing thrust in Z direction -------- void Quadcopter::run (float* speed){