Mbed library to control a motor via DRV8833 H-bridge motor controller. Uses two Pwmouts.
Diff: DRV8833.h
- Revision:
- 2:ccc9acaebd38
- Parent:
- 1:048f85990e31
- Child:
- 3:0aa2cdeb2e2b
--- a/DRV8833.h Tue Oct 15 12:45:59 2013 +0000 +++ b/DRV8833.h Mon Dec 02 08:02:08 2013 +0000 @@ -17,8 +17,8 @@ #include "mbed.h" -#define BRAKE_FAST 1 -#define BRAKE_SLOW 0 +#define COAST 1 +#define BRAKE 0 /** Interface to control a standard DC motor * with an DRV8833 H-bridge motor controller @@ -49,14 +49,14 @@ */ void period(float period); - /** Brake the H-bridge to fast or slow. + /** Brake the H-bridge coast or brake. * - * Defaults to breaking fast. + * Defaults to coast. * - * Brake fast(coast) => pwm1 = pwm2 = 0 - * Brake slow => pwm1 = pwm2 = 1 + * Coast => pwm1 = pwm2 = 0 + * Brake => pwm1 = pwm2 = 1 */ - void brake(int highLow = BRAKE_FAST); + void brake(int mode = COAST); protected: PwmOut _pwm1;