Control an H-Bridge using a PwmOut (enable) and two DigitalOuts (direction select) For maxon controll

Dependents:   NHK2015 NHK2015_new

Fork of Motor by Simon Ford

Revision:
4:e98b342edd25
Parent:
3:d35b291eb6f2
--- a/Motor.cpp	Thu Sep 03 02:36:46 2015 +0000
+++ b/Motor.cpp	Thu Sep 10 07:27:18 2015 +0000
@@ -41,6 +41,8 @@
     _rev = (speed < 0.0);
     _pwm = abs(speed);
 }
+void Motor::setfrequency(float frequency) {
+    _pwm.period(1/frequency);
+}
 
 
-