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.
Dependencies: SoftPWM
Fork of RC_Servo by
Diff: RC_Servo.h
- Revision:
- 7:014d36c33b73
- Parent:
- 6:cf65fc8b0de1
- Child:
- 8:df674a9d9535
--- a/RC_Servo.h Tue Jun 05 07:25:09 2018 +0000
+++ b/RC_Servo.h Tue Jun 05 12:22:17 2018 +0000
@@ -39,6 +39,7 @@
* Includes : Mbed Library
*/
#include "mbed.h"
+#include "SoftPWM.h"
/**
* RC_Servo
@@ -51,11 +52,6 @@
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
@@ -77,21 +73,18 @@
*
* @param position : float number between 0 and 1 (0 = Min, 1 = Max)
*/
- void write (float position);
+ void write (double position);
/**
* A short hand for write
*/
- RC_Servo& operator= (float position);
+ RC_Servo& operator= (double position);
private :
int _RCpMin, _RCpMax;
- Ticker _tickRC;
-
- void generatePwm (void);
+ SoftPWM _RCpwm;
protected :
- DigitalOut _RCpwm ;
};
#endif //GP2A_H
\ No newline at end of file
