ArPiRobot-CoreLib C++
C++ library for ArPiRobot robots
Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
arpirobot::AdafruitMotorHatMotor Class Reference

#include <arpirobot/devices/adafruitmotorhatmotor/AdafruitMotorHatMotor.hpp>

Inheritance diagram for arpirobot::AdafruitMotorHatMotor:
arpirobot::MotorController arpirobot::BaseDevice

Public Member Functions

 AdafruitMotorHatMotor (int motorNum, int address=DETECT_ADDR, int bus=-1, bool remapNumbers=true)
 
 AdafruitMotorHatMotor (const AdafruitMotorHatMotor &other)=delete
 
AdafruitMotorHatMotoroperator= (const AdafruitMotorHatMotor &other)=delete
 
- Public Member Functions inherited from arpirobot::MotorController
bool isInverted ()
 
void setInverted (bool inverted)
 
bool isBrakeMode ()
 
void setBrakeMode (bool brakeMode)
 
double getSpeed ()
 
void setSpeed (double speed)
 
- Public Member Functions inherited from arpirobot::BaseDevice
virtual std::string getDeviceName ()
 
bool isLockedByAction (std::shared_ptr< Action > action=nullptr)
 Check if a given action locks the device. More...
 
bool isLockedByAction (Action &action)
 Check if a given action locks the device. More...
 

Static Public Attributes

static const int ADAFRUIT_ADDR
 
static const int GEEKWORM_ADDR
 
static const int DETECT_ADDR
 

Protected Member Functions

void begin () override
 
void run () override
 
- Protected Member Functions inherited from arpirobot::MotorController
bool isEnabled () override
 
bool shouldMatchRobotState () override
 
bool shouldDisableWithWatchdog () override
 
void enable () override
 
void disable () override
 

Additional Inherited Members

- Protected Attributes inherited from arpirobot::MotorController
double speed = 0
 
std::mutex lock
 
bool enabled = false
 
bool brakeMode = false
 
int8_t speedFactor = 1
 
- Protected Attributes inherited from arpirobot::BaseDevice
bool initialized = false
 
std::string deviceName
 

Detailed Description

Motor for Adafruit Motor Hat

Constructor & Destructor Documentation

◆ AdafruitMotorHatMotor()

arpirobot::AdafruitMotorHatMotor::AdafruitMotorHatMotor ( int  motorNum,
int  address = DETECT_ADDR,
int  bus = -1,
bool  remapNumbers = true 
)
Parameters
motorNumThe number for the motor
addressThe address of the hat for the motor
busThe i2c bus the motor's hat is on
remapNumbersIf true the motor numbers will be remapped (if needed) to match the physical order of the Adafruit motor hat

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