Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 10:573cd4808d91, committed 2015-11-21
- 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;