simplify for single SG90

Dependents:   lidarproj

Fork of SG90 by Mathias Lyngklip

Revision:
1:93e46a70966f
Parent:
0:a62b163b1dbb
--- a/SG90.h	Sat Apr 05 07:56:43 2014 +0000
+++ b/SG90.h	Mon Jun 18 12:02:48 2018 +0000
@@ -1,24 +1,12 @@
 #ifndef SG90_H
 #define SG90_H
 #include "mbed.h"
-#include "PwmOut.h"
 
-class servo {
-    
+class SG90:public PwmOut{
 public:
-
-PwmOut pwm1, pwm2, pwm3, pwm4;
-servo();
-
-
-void init();
-void right(int);
-void left(int);
-void position(int, int);
-
-int s1, s2, s3, s4;
-
-
-
+    SG90(PinName pwnPin);
+    void SetAngle(float fAngle);
+private:
+    int iPreRotate;
 };
-#endif
\ No newline at end of file
+#endif