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: 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;
}
