NOT FINISHED YET!!! My first try to get a self built fully working Quadrocopter based on an mbed, a self built frame and some other more or less cheap parts.
Diff: Servo/Servo.cpp
- Revision:
- 9:4e0c3936c756
- Parent:
- 7:9d4313510646
- Child:
- 29:8b7362a2ee14
--- a/Servo/Servo.cpp Mon Oct 15 19:03:17 2012 +0000 +++ b/Servo/Servo.cpp Tue Oct 16 10:21:32 2012 +0000 @@ -2,13 +2,14 @@ #include "mbed.h" Servo::Servo(PinName Pin) : ServoPin(Pin) { + initialize(); // TODO: Works? } void Servo::initialize() { // initialize ESC - Enable(2000,20000); // full throttle - wait(0.01); // for 0.01 secs - SetPosition(1000); // low throttle + Enable(2000,20000); // full throttle + wait(0.01); // for 0.01 secs + SetPosition(1000); // low throttle } void Servo::SetPosition(int Pos) { @@ -21,6 +22,9 @@ } void Servo::EndPulse() { + // my change + PulseStop.detach(); + // my change ServoPin = 0; }