27#if defined(CONF_DMOTOR)
63 : mLeft(lport), mRight(rport) {}
78 }
else if (dir ==
::rev) {
178#warning Enable CONF_DMOTOR to use MotorPair.H
C++ Motor Class Interface.
Pair-of-motors control interface.
void pivotRight(const int s) const
turn right at speed {s} but pivot around right wheel
void forward() const
move forward
void pivotRight() const
turn right about the right wheel of the robot
void brake() const
stop without coasting
MotorPair(const Motor::Port lport, const Motor::Port rport)
define a pair of motors specifying the connection of each to the RCX
void left() const
turn left about the center of the robot
void off() const
stop but allow coasting
void brake(const int ms) const
apply the brakes to both motors then delay for {ms} mSec
void speed(const int s) const
set the speed of our two motors
void pivotLeft(const int s) const
turn left at speed {s} but pivot around left wheel
void pivotLeft() const
turn left about the left wheel of the robot
void left(const int s) const
turn left at speed {s}
void direction(const MotorDirection dir) const
set the direction of our two motors
void reverse() const
move reverse
void reverse(const int s) const
move reverse (go backwards) at speed {s}
void forward(const int s) const
move forward at speed {s}
~MotorPair()
destroy this MotorPair instance
Limits
the minimum and maximum speeds a motor can go, its limits.
@ max
maximum motor speed setting
@ min
minimum motor speed setting
void right(const int s) const
turn right at speed {s}
void right() const
turn right about the center of the robot
Port
valid port designators
@ min
Minimum velocity (0)
@ max
Maximum velocity (255)
const void speed(const unsigned char speed) const
set the motor speed
const void direction(const MotorDirection dir) const
set the motor direction
const void brake() const
set the motor to brake
Interface: console input / output.
void delay(unsigned ms)
delay approximately ms mSec
MotorDirection
the motor directions