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.
Revision 4:28641fc3becc, committed 2019-05-02
- Comitter:
- sbetrabet
- Date:
- Thu May 02 07:07:50 2019 +0000
- Parent:
- 3:36b69a7ced07
- Commit message:
- Made some changes to the signal
Changed in this revision
| Servo.cpp | Show annotated file Show diff for this revision Revisions of this file |
| Servo.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/Servo.cpp Thu Sep 02 17:34:43 2010 +0000
+++ b/Servo.cpp Thu May 02 07:07:50 2019 +0000
@@ -40,8 +40,8 @@
}
void Servo::write(float percent) {
- float offset = _range * 2.0 * (percent - 0.5);
- _pwm.pulsewidth(0.0015 + clamp(offset, -_range, _range));
+ float offset = _range * 2.0 * (percent-0.5);
+ _pwm.pulsewidth(0.0013 + clamp(offset, -_range, _range));
_p = clamp(percent, 0.0, 1.0);
}
--- a/Servo.h Thu Sep 02 17:34:43 2010 +0000
+++ b/Servo.h Thu May 02 07:07:50 2019 +0000
@@ -81,7 +81,7 @@
* @param range Pulsewidth range from center (1.5ms) to maximum/minimum position in seconds
* @param degrees Angle from centre to maximum/minimum position in degrees
*/
- void calibrate(float range = 0.0005, float degrees = 45.0);
+ void calibrate(float range = 0.0011, float degrees = 90.0);
/** Shorthand for the write and read functions */
Servo& operator= (float percent);