Motor

Dependents:   ASEE-2014 frdm_Wall

Fork of Motor by Christopher Bradford

Files at this revision

API Documentation at this revision

Comitter:
cbradford
Date:
Thu Mar 06 02:21:13 2014 +0000
Parent:
3:7f1fd2d62c72
Commit message:
Fixed stuff

Changed in this revision

Motor.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Motor.cpp	Thu Feb 27 01:40:41 2014 +0000
+++ b/Motor.cpp	Thu Mar 06 02:21:13 2014 +0000
@@ -35,10 +35,14 @@
 }
 
 void Motor::speed(float speed) {
-    if(speed > 0.0)
+    if(speed > 0.0){
         _fwd = abs(speed);
-    else
+        _rev = 0;
+    }
+    else{
         _rev = abs(speed);
+        _fwd = 0;
+    }
 }