project for nrf51822 qfab
Dependencies: eddystone_URL mbed
Fork of eddystone_URL by
Diff: TB6612FNG/TB6612.cpp
- Revision:
- 2:3c406d25860e
- Parent:
- 0:76dfa9657d9d
--- a/TB6612FNG/TB6612.cpp Tue Nov 18 04:28:02 2014 +0000 +++ b/TB6612FNG/TB6612.cpp Fri Feb 20 00:07:48 2015 +0000 @@ -43,8 +43,11 @@ // float speed -1.0 - 0.0 - 1.0 float TB6612::speed(float speed) { + + if( speed > 0.0 ) { + if( speed > 0.7) speed = 0.7; _pwm = speed; _fwd = 1; _rev = 0; @@ -52,6 +55,7 @@ } else if( speed < 0.0 ) { + if( speed < -0.7) speed = -0.7; _pwm = -speed; _fwd = 0; _rev = 1;