Mbed library to control a motor via DRV8833 H-bridge motor controller. Uses two Pwmouts.
Diff: DRV8833.cpp
- Revision:
- 2:ccc9acaebd38
- Parent:
- 0:80e26be59f41
- Child:
- 3:0aa2cdeb2e2b
--- a/DRV8833.cpp Tue Oct 15 12:45:59 2013 +0000 +++ b/DRV8833.cpp Mon Dec 02 08:02:08 2013 +0000 @@ -46,14 +46,15 @@ _pwm2.period(period); } -void DRV8833::brake(int highLow){ +void DRV8833::brake(int mode){ - if(highLow == BRAKE_FAST) + if(mode == COAST) { _pwm1 = 0; _pwm2 = 0; } - else if(highLow == BRAKE_SLOW){ + else if(mode == BRAKE) + { _pwm1 = 1; _pwm2 = 1; }