ArPiRobot-CoreLib C++
C++ library for ArPiRobot robots
|
#include <arpirobot/devices/adafruitmotorhatmotor/AdafruitMotorHatMotor.hpp>
Public Member Functions | |
AdafruitMotorHatMotor (int motorNum, int address=DETECT_ADDR, int bus=-1, bool remapNumbers=true) | |
AdafruitMotorHatMotor (const AdafruitMotorHatMotor &other)=delete | |
AdafruitMotorHatMotor & | operator= (const AdafruitMotorHatMotor &other)=delete |
![]() | |
bool | isInverted () |
void | setInverted (bool inverted) |
bool | isBrakeMode () |
void | setBrakeMode (bool brakeMode) |
double | getSpeed () |
void | setSpeed (double speed) |
![]() | |
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 |
![]() | |
bool | isEnabled () override |
bool | shouldMatchRobotState () override |
bool | shouldDisableWithWatchdog () override |
void | enable () override |
void | disable () override |
Additional Inherited Members | |
![]() | |
double | speed = 0 |
std::mutex | lock |
bool | enabled = false |
bool | brakeMode = false |
int8_t | speedFactor = 1 |
![]() | |
bool | initialized = false |
std::string | deviceName |
Motor for Adafruit Motor Hat
arpirobot::AdafruitMotorHatMotor::AdafruitMotorHatMotor | ( | int | motorNum, |
int | address = DETECT_ADDR , |
||
int | bus = -1 , |
||
bool | remapNumbers = true |
||
) |
motorNum | The number for the motor |
address | The address of the hat for the motor |
bus | The i2c bus the motor's hat is on |
remapNumbers | If true the motor numbers will be remapped (if needed) to match the physical order of the Adafruit motor hat |