Smartcar Shield
|
#include <Motor.hpp>
Public Member Functions | |
virtual | ~Motor ()=default |
virtual void | setSpeed (int speed)=0 |
Sets the motor speed and direction as the percentage of the maximum possible speed, where the sign of the argument represents the direction. More... | |
Interface programmatically representing any kind of motor. Fundamentally, a motor is something you can control the speed and direction of its rotation.
|
virtualdefault |
|
pure virtual |
Sets the motor speed and direction as the percentage of the maximum possible speed, where the sign of the argument represents the direction.
speed | The speed and direction within the range of [-100, 100]. -100 means that the motor is spinning at full speed towards the direction we have defined as backward. 100 interpreted as full speed forward. 0 means that the motor is at its idle/neutral state. |
Example:
Implemented in BrushedMotor, ServoMotor, and DualMotor.