DriveMaster
Loading...
Searching...
No Matches
DriveMaster Class Reference

Base class for motor control. More...

#include <DriveMaster.h>

Inheritance diagram for DriveMaster:
[legend]

Public Member Functions

 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.
 

Protected Attributes

int _pin
 
int _dir_pin
 

Detailed Description

Base class for motor control.

Constructor & Destructor Documentation

◆ DriveMaster() [1/2]

DriveMaster::DriveMaster ( int pin)

Construct a new DriveMaster object with only the pin.

Parameters
pinThe 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
pinThe pin number for motor control.
dir_pinThe pin number for direction control.

Member Function Documentation

◆ 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
valueThe command value to send.

◆ sendValue()

void DriveMaster::sendValue ( uint16_t value)
virtual

Send a value to the motor.

Parameters
valueThe value to send.

◆ 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
    valueThe 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
valueThe command value to write.
telemetryFlag indicating telemetry presence.

Member Data Documentation

◆ _dir_pin

int DriveMaster::_dir_pin
protected

Pin number for direction control.

◆ _pin

int DriveMaster::_pin
protected

Pin number for motor control.


The documentation for this class was generated from the following files: