TB6612FNG用のモータコントロールライブラリ
Dependents: TB6612FNG_test line_trace_sample line_trace_sample_saitou line_trace_sample_tamada ... more
Diff: TB6612.cpp
- Revision:
- 4:95d5e9ee8c15
- Parent:
- 2:ad4e7374e5c1
- Child:
- 5:80ac3e662fe4
--- a/TB6612.cpp Mon Jul 07 14:44:34 2014 +0000 +++ b/TB6612.cpp Fri Aug 29 04:40:40 2014 +0000 @@ -33,6 +33,7 @@ _fwd = 0; _rev = 0; _pwm = 0.0; + stat = 0; _pwm.period(0.001); } @@ -47,17 +48,20 @@ _pwm = speed; _fwd = 1; _rev = 0; + stat = 1; } else if( speed < 0.0 ) { _pwm = -speed; _fwd = 0; _rev = 1; + stat = -1; } else { _fwd = 1; _rev = 1; + stat = 0; } return speed==0 ? 0 : speed > 0 ? 1 : -1; } \ No newline at end of file