Motor
Dependents: ASEE-2014 frdm_Wall
Fork of Motor by
Diff: Motor.cpp
- Revision:
- 4:de727286a2a8
- Parent:
- 3:7f1fd2d62c72
diff -r 7f1fd2d62c72 -r de727286a2a8 Motor.cpp --- 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; + } }