A library to control a CYS S8218 servo

Dependents:   Heiko

Files at this revision

API Documentation at this revision

Comitter:
kerneels.bez@gmail.com
Date:
Mon Oct 10 08:19:18 2016 +0200
Parent:
4:c43d375a84a9
Child:
6:87b056f6d8ad
Commit message:
Added Off() function

Changed in this revision

CYS8218Controller.cpp Show annotated file Show diff for this revision Revisions of this file
CYS8218Controller.hpp Show annotated file Show diff for this revision Revisions of this file
--- a/CYS8218Controller.cpp	Tue Sep 27 19:55:10 2016 +0000
+++ b/CYS8218Controller.cpp	Mon Oct 10 08:19:18 2016 +0200
@@ -49,3 +49,8 @@
 {
   ZEROPW = (ZEROPW+angle*PW_PER_DEG);
 }
+
+void CYS8218Controller::Off()
+{
+    _servo.pulsewidth(0);
+}
--- a/CYS8218Controller.hpp	Tue Sep 27 19:55:10 2016 +0000
+++ b/CYS8218Controller.hpp	Mon Oct 10 08:19:18 2016 +0200
@@ -48,6 +48,11 @@
    */
   void Move(float relAngle);
 
+  /**
+   * Disables control signal to servo
+   */
+  void Off();
+
 
 private:
   PwmOut _servo;