A simple library for driving RC servos without using the mbed's PWM functions. This allows the mbed to drive as many servos as there are DigitalOut pins, and additionally allows for the PWM functions to be used at a different frequency than the 50Hz used for servos.

Revision:
13:896410a1b594
Parent:
10:f0df63e99a96
Child:
14:0eff26aa0d17
--- a/Servo.cpp	Sun Oct 21 01:29:15 2012 +0000
+++ b/Servo.cpp	Wed Jan 09 21:06:59 2013 +0000
@@ -37,13 +37,13 @@
 
 
 
-bool Servo::calibrate(unsigned int plus60, unsigned int minus60, float upperLimit, float lowerLimit)
+bool Servo::calibrate(unsigned int plus45, unsigned int minus45, float upperLimit, float lowerLimit)
 {
     // Check if given parameters are valid
     if (upperLimit > lowerLimit)
     {
-        center = (plus60 + minus60) / 2;
-        usPerDegree = ((int)plus60 - (int)center) / 60.0f;
+        center = (plus45 + minus45) / 2;
+        usPerDegree = ((int)plus45 - (int)center) / 45.0f;
         this->upperLimit = upperLimit;
         this->lowerLimit = lowerLimit;   
         return true;