RoboidControl for Arduino
|
A Motor is a Thing which can move parts of the Roboid. More...
#include <Motor.h>
Public Types | |
enum class | Direction { Clockwise = 1 , CounterClockwise = -1 } |
Motor turning direction. More... | |
Public Member Functions | |
Motor () | |
Default constructor for the Motor. | |
virtual void | SetSpeed (float speed) |
Set the target motor speed. | |
virtual float | GetSpeed () |
Get the current target speed of the motor. | |
bool | IsMotor () |
Check if the Thing is a Motor. | |
bool | IsSensor () |
Check if the Thing is a Sensor. | |
Public Attributes | |
Direction | direction = Direction::Clockwise |
The forward turning direction of the motor. | |
unsigned int | type |
The type of Thing. | |
Static Public Attributes | |
static const unsigned int | SwitchType = SensorType | (unsigned int)Type::Switch |
static const unsigned int | DistanceSensorType |
static const unsigned int | ControlledMotorType |
static const unsigned int | UncontrolledMotorType |
Protected Types | |
enum class | Type { Undetermined , Switch , DistanceSensor , ControlledMotor , UncontrolledMotor } |
Basic Thing types. More... | |
Protected Attributes | |
float | currentTargetSpeed = 0 |
Static Protected Attributes | |
static const unsigned int | MotorType = 0x8000 |
Bitmask for Motor type. | |
static const unsigned int | SensorType = 0x4000 |
Bitmap for Sensor type. | |
A Motor is a Thing which can move parts of the Roboid.
|
strong |
Motor turning direction.
Enumerator | |
---|---|
Clockwise | |
CounterClockwise |
|
strongprotectedinherited |
Basic Thing types.
Enumerator | |
---|---|
Undetermined | |
Switch | |
DistanceSensor | |
ControlledMotor | |
UncontrolledMotor |
Motor::Motor | ( | ) |
Default constructor for the Motor.
|
virtual |
Set the target motor speed.
speed | The speed between -1 (full backward), 0 (stop) and 1 (full forward) |
Reimplemented in Passer::RoboidControl::TB6612Motor, and Passer::RoboidControl::DRV8833Motor.
|
virtual |
Get the current target speed of the motor.
|
inherited |
|
inherited |
Direction Passer::RoboidControl::Motor::direction = Direction::Clockwise |
The forward turning direction of the motor.
|
protected |
|
inherited |
The type of Thing.
|
staticinherited |
|
staticinherited |
|
staticinherited |
|
staticinherited |
|
staticprotectedinherited |
Bitmask for Motor type.
|
staticprotectedinherited |
Bitmap for Sensor type.