PicoLowLevel
|
Motor class used to control simple DC motors. More...
#include <Motor.h>
Public Member Functions | |
Motor (byte pwm, byte dir, bool invert=false) | |
Create object and set motor pins. | |
void | begin () |
Initialize motors. | |
void | write (int value) |
Sets the motor speed. | |
Motor class used to control simple DC motors.
Motor::Motor | ( | byte | pwm, |
byte | dir, | ||
bool | invert = false |
||
) |
Create object and set motor pins.
pwm | PWM pin. |
dir | Direction pin. |
invert | Invert motor direction, usuful when motors are mounted opposite to one another. |
void Motor::begin | ( | ) |
Initialize motors.
void Motor::write | ( | int | value | ) |
Sets the motor speed.
value | Speed of the motor, ranging from 0 to maximum PWM value. |