Servo

Fork of Servo by Simon Ford

Files at this revision

API Documentation at this revision

Comitter:
pierro42100
Date:
Fri Sep 11 11:02:32 2015 +0000
Parent:
3:36b69a7ced07
Commit message:
test

Changed in this revision

Servo.h Show annotated file Show diff for this revision Revisions of this file
--- a/Servo.h	Thu Sep 02 17:34:43 2010 +0000
+++ b/Servo.h	Fri Sep 11 11:02:32 2015 +0000
@@ -49,28 +49,30 @@
  * }
  * @endcode
  */
+ 
+ //Définition de la classe Servo
 class Servo {
 
 public:
-    /** Create a servo object connected to the specified PwmOut pin
+    /** Création d'un objet servo associé à la pin (broche) indiquée
      *
      * @param pin PwmOut pin to connect to 
      */
     Servo(PinName pin);
     
-    /** Set the servo position, normalised to it's full range
+    /** Imposer au servo une position. Cette position est normalisée (pourcentage), par rapport à son amplitude max.
      *
      * @param percent A normalised number 0.0-1.0 to represent the full range.
      */
     void write(float percent);
     
-    /**  Read the servo motors current position
+    /** Renvoit la position courante du servo
      *
      * @param returns A normalised number 0.0-1.0  representing the full range.
      */
     float read();
     
-    /** Set the servo position
+    /** Impose au servo une position en degrés
      *
      * @param degrees Servo position in degrees
      */
@@ -88,11 +90,13 @@
     Servo& operator= (Servo& rhs);
     operator float();
 
+//Attributs
+
 protected:
-    PwmOut _pwm;
-    float _range;
-    float _degrees;
-    float _p;
+    PwmOut _pwm;//la broche (pin)
+    float _range;//l'amplitude
+    float _degrees;//la position en degrés
+    float _p; //la position relative
 };
 
 #endif