|
| Motor (const Port port) |
| construct a motor connected to {port} More...
|
|
| ~Motor () |
| destroy our motor instance More...
|
|
const void | speed (const unsigned char speed) const |
| set the motor speed More...
|
|
const void | direction (const MotorDirection dir) const |
| set the motor direction More...
|
|
const void | forward () const |
| set motor direction to forward More...
|
|
const void | forward (const unsigned char s) const |
| set motor direction to forward at speed {s} More...
|
|
const void | reverse () const |
| set the motor direction to reverse More...
|
|
const void | reverse (const unsigned char s) const |
| set the motor direction to reverse at speed {s} More...
|
|
const void | brake () const |
| set the motor to brake More...
|
|
const void | brake (int duration) const |
| set the motor to brake and delay return More...
|
|
const void | off () const |
| turn the motor off this disables power and the motor coasts to a stop More...
|
|
Motor control interface.
This class is designed to manipulate motors attached to an RCX
- See also
- The other control classes: MotorPair, Sound, Lamp
- Design Note
- I avoided using derived classes since they were typically three times larger. Also, if one is using Motor(Motor::A), all the decision logic is optimized away in the compiler, so no extra space is used for that.
Definition at line 38 of file Motor.H.