Control a DC motor via a standard H-bridge using a PwmOut pin to control speed and two DigitalOut pins to control direction. Can change pwm period on the PwmOut pin, and also brake high or low.
Fork of Motor by
Motor Class Reference
Interface to control a standard DC motor with an H-bridge using a PwmOut and 2 DigitalOuts. More...
#include <Motor.h>
Public Member Functions | |
Motor (PinName pwm, PinName fwd, PinName rev) | |
Create a motor control interface. | |
void | speed (float speed) |
Set the speed of the motor. | |
void | period (float period) |
Set the period of the pwm duty cycle. | |
void | brake (int highLow=BRAKE_LOW) |
Brake the H-bridge to GND or VCC. |
Detailed Description
Interface to control a standard DC motor with an H-bridge using a PwmOut and 2 DigitalOuts.
Definition at line 34 of file Motor.h.
Constructor & Destructor Documentation
Motor | ( | PinName | pwm, |
PinName | fwd, | ||
PinName | rev | ||
) |
Member Function Documentation
void brake | ( | int | highLow = BRAKE_LOW ) |
void period | ( | float | period ) |
Generated on Tue Jul 12 2022 21:40:41 by 1.7.2