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.
Dependents: ASEE-2014 frdm_Wall
Fork of Motor by
Revision 4:de727286a2a8, committed 2014-03-06
- 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;
+ }
}
