Team 9 / Motor

Files at this revision

API Documentation at this revision

Comitter:
ng3600
Date:
Sat Nov 21 04:19:12 2015 +0000
Parent:
6:a9ab4e153009
Commit message:
Added case here speed == 0, send no pwm and activate brakes.

Changed in this revision

Motor.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Motor.cpp	Thu May 21 06:33:47 2015 +0000
+++ b/Motor.cpp	Sat Nov 21 04:19:12 2015 +0000
@@ -104,7 +104,7 @@
     float delta_spd = target_spd - actual_spd;
     
     //if delta_spd large, brake this cycle.
-    if(delta_spd < -0.35){
+    if(delta_spd < -0.35 || target_spd <= 0){
         motor->write(0.0);
         *brake = 1;
         return;