A class for driving a DC motor using a full-bridge (H-bridge) driver.
Dependencies: RateLimiter
Dependents: L298N-Breakout-Test Zavrsni_rad_NXP_cup
Diff: HBridgeDCMotor.h
- Revision:
- 1:fb5553d9ff4c
- Parent:
- 0:d3f1d0d52615
- Child:
- 2:1675a4c00925
diff -r d3f1d0d52615 -r fb5553d9ff4c HBridgeDCMotor.h --- a/HBridgeDCMotor.h Wed Jan 14 08:51:14 2015 +0000 +++ b/HBridgeDCMotor.h Wed Jan 14 10:37:57 2015 +0000 @@ -14,6 +14,8 @@ * A and B designate the individual half-bridges. */ HBridgeDCMotor(PinName GH_A, PinName GL_A, PinName GH_B, PinName GL_B); + /** Configure the parameters (sample time in seconds, switching frequency in Hz). */ + void configure(float sampleTime, float switchingFrequency, float rampUpSlope, float rampDownSlope); /** Set the duty cycle value in range (-1, 1). Negative value means opposite direction. */ void setDutyCycle(float dutyCycle); /** Put the drive in a coast mode. */