Library for driving the IBT-2 H-bridge motor controller (with BTS 7960 or BTN 7971 half bridges).
See the Wiki tab for example code.
Diff: IBT2.h
- Revision:
- 1:fe72c69ab361
- Parent:
- 0:ea214158c2fb
diff -r ea214158c2fb -r fe72c69ab361 IBT2.h --- a/IBT2.h Fri Jul 31 20:05:31 2015 +0000 +++ b/IBT2.h Fri Jul 31 20:30:06 2015 +0000 @@ -28,16 +28,19 @@ /** Interface to the IBT-2 H-bridge motor controller * * Control a DC motor connected to the IBT-2 H-bridge using one of two modes: + * * Mode 1: * 2 PwmOuts and 1 DigitalOut * - L_PWM controlled with a PwmOut * - R_PWM controlled with a PwmOut * - L_EN, R_EN connected to a DigitalOut (High is Enabled) - * Mode 1: - * 2 PwmOuts and 1 DigitalOut - * - L_PWM controlled with a PwmOut - * - R_PWM controlled with a PwmOut - * - L_EN, R_EN connected to a DigitalOut (High is Enabled) + * + * Mode 2: + * 1 PwmOut and 2 DigitalOuts + * - L_PWM connected to a DigitalOut (High is Forward; keep R_PWM Low) + * - R_PWM connected to a DigitalOut (High is Reverse; keep L_PWM Low) + * - L_EN, R_EN controlled with a PwmOut + * * For now, only Mode 1 is used. */ class IBT2 { @@ -59,7 +62,7 @@ /** Get the speed and direction of the motor * - * @returns float The speed of the motor as a normalized value between -1.0 and 1.0. A positive value is forward and a negative value is reverse. + * @returns The speed of the motor as a normalized value between -1.0 and 1.0. A positive value is forward and a negative value is reverse. */ float getSpeed(void);