Cannon Ball

Fork of Servo by Simon Ford

Files at this revision

API Documentation at this revision

Comitter:
Malek0512
Date:
Fri Apr 03 20:09:09 2015 +0000
Parent:
3:36b69a7ced07
Commit message:
Version a tester;

Changed in this revision

Servo.cpp Show annotated file Show diff for this revision Revisions of this file
Servo.h Show annotated file Show diff for this revision Revisions of this file
diff -r 36b69a7ced07 -r f292f148fc87 Servo.cpp
--- a/Servo.cpp	Thu Sep 02 17:34:43 2010 +0000
+++ b/Servo.cpp	Fri Apr 03 20:09:09 2015 +0000
@@ -72,3 +72,11 @@
 Servo::operator float() {
     return read();
 }
+
+void Servo::write_ms(float time) {
+    _pwm.pulsewidth(time/1000);
+}
+
+void Servo::write_s(float time) {
+    _pwm.pulsewidth(time);
+}
\ No newline at end of file
diff -r 36b69a7ced07 -r f292f148fc87 Servo.h
--- a/Servo.h	Thu Sep 02 17:34:43 2010 +0000
+++ b/Servo.h	Fri Apr 03 20:09:09 2015 +0000
@@ -88,6 +88,9 @@
     Servo& operator= (Servo& rhs);
     operator float();
 
+    void write_ms(float time);
+    void write_s(float time);
+    
 protected:
     PwmOut _pwm;
     float _range;