Pulse Width Modulation RC Servomotor Library compatible with classic and extended models. Models limit are customizable

Dependents:   FRC_2018 0hackton_08_06_18 0hackton_08_06_18_publish Kenya_2019 ... more

Revision:
6:cf65fc8b0de1
Parent:
5:9b1e318db5f1
Child:
7:014d36c33b73
--- a/RC_Servo.h	Thu May 31 17:26:54 2018 +0000
+++ b/RC_Servo.h	Tue Jun 05 07:25:09 2018 +0000
@@ -51,6 +51,11 @@
 public :
 
     /**
+     * Global Variable that define pulsewidth in microsecond
+     */
+    long RCdelay; 
+
+    /**
      * Constructor of a RC Servo (analog).
      *
      * @param PWM (PinName) : is the Mbed pin used to generate the PWM signal
@@ -80,10 +85,13 @@
     RC_Servo& operator= (float position);
 
 private :
-    int _pMin, _pMax;
+    int         _RCpMin, _RCpMax;
+    Ticker      _tickRC;
+    
+    void generatePwm (void);
 
 protected :
-    PwmOut    _pwm ;
+    DigitalOut  _RCpwm ;
 
 };
 #endif //GP2A_H
\ No newline at end of file