keisuke Yoshida
/
BLE_WallbotBLE_Challenge_byYUTAKA
under constructiong
Fork of BLE_WallbotBLE_Challenge by
Diff: TB6612FNG/TB6612.cpp
- Revision:
- 2:3c406d25860e
- Parent:
- 0:76dfa9657d9d
- Child:
- 3:f707552ec50a
--- 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;