Extend Motordriver library

Fork of Motordriver by Christopher Hasler

Files at this revision

API Documentation at this revision

Comitter:
Nasupl
Date:
Wed Dec 03 07:11:52 2014 +0000
Parent:
5:3110b9209d3c
Commit message:
I have added a function to change the PWM frequency.

Changed in this revision

motordriver.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/motordriver.cpp	Thu Nov 25 13:34:15 2010 +0000
+++ b/motordriver.cpp	Wed Dec 03 07:11:52 2014 +0000
@@ -46,6 +46,10 @@
     sign = 0;//i.e nothing.
 }
 
+void Motor::setPwmFreq(float sec) {
+    _pwm.period(sec);
+}
+
 float Motor::speed(float speed) {
     float temp = 0;
     if (sign == 0) {