Base class for motor control.
More...
#include <DriveMaster.h>
|
| DriveMaster (int pin) |
| Construct a new DriveMaster object with only the pin.
|
|
| DriveMaster (int pin, int dir_pin) |
| Construct a new DriveMaster object with the specified pin and direction pin.
|
|
virtual | ~DriveMaster () |
| Destroy the DriveMaster object.
|
|
virtual void | begin () |
| Initialize the motor control.
|
|
virtual void | write (uint16_t value, bool telemetery=false) |
| Write a command to the motor.
|
|
virtual void | write (int16_t value) |
| Write a command to the motor using an 8-bit signed integer value. The value ranges from -255 to 255, where:
|
|
virtual void | sendCommand (uint16_t value) |
| Send a command to the motor.
|
|
virtual void | sendValue (uint16_t value) |
| Send a value to the motor.
|
|
Base class for motor control.
◆ DriveMaster() [1/2]
DriveMaster::DriveMaster |
( |
int | pin | ) |
|
Construct a new DriveMaster object with only the pin.
- Parameters
-
pin | The pin number for motor control. |
◆ DriveMaster() [2/2]
DriveMaster::DriveMaster |
( |
int | pin, |
|
|
int | dir_pin ) |
Construct a new DriveMaster object with the specified pin and direction pin.
- Parameters
-
pin | The pin number for motor control. |
dir_pin | The pin number for direction control. |
◆ begin()
void DriveMaster::begin |
( |
| ) |
|
|
virtual |
Initialize the motor control.
Reimplemented in HBridge.
◆ sendCommand()
void DriveMaster::sendCommand |
( |
uint16_t | value | ) |
|
|
virtual |
Send a command to the motor.
- Parameters
-
value | The command value to send. |
◆ sendValue()
void DriveMaster::sendValue |
( |
uint16_t | value | ) |
|
|
virtual |
Send a value to the motor.
- Parameters
-
◆ write() [1/2]
void DriveMaster::write |
( |
int16_t | value | ) |
|
|
virtual |
Write a command to the motor using an 8-bit signed integer value. The value ranges from -255 to 255, where:
- 255 is full speed forward
- -255 is full speed reverse
- 0 is stop
- Parameters
-
value | The signed 8-bit command value to write (-255 to 255). |
Reimplemented in HBridge.
◆ write() [2/2]
void DriveMaster::write |
( |
uint16_t | value, |
|
|
bool | telemetery = false ) |
|
virtual |
Write a command to the motor.
- Parameters
-
value | The command value to write. |
telemetry | Flag indicating telemetry presence. |
◆ _dir_pin
int DriveMaster::_dir_pin |
|
protected |
Pin number for direction control.
◆ _pin
Pin number for motor control.
The documentation for this class was generated from the following files: