#include <MotorPair.H>
Collaboration diagram for MotorPair:
Public Types | |||
enum | Limits { min = Motor::min, max = Motor::max } | ||
the minimum and maximum speeds a motor can go, its limits. More... | |||
Public Methods | |||
MotorPair (const Motor::Port lport, const Motor::Port rport) | |||
define a pair of motors specifying the connection of each to the RCX. More... | |||
~MotorPair () | |||
destroy this MotorPair instance
| |||
void | speed (const int s) const | ||
set the speed of our two motors. More... | |||
void | direction (const MotorDirection dir) const | ||
set the direction of our two motors
| |||
void | forward () const | ||
move forward. More... | |||
void | reverse () const | ||
move reverse. More... | |||
void | brake () const | ||
stop without coasting. More... | |||
void | off () const | ||
stop but allow coasting. More... | |||
void | left () const | ||
turn left about the center of the robot
| |||
void | pivotLeft () const | ||
turn left about the left wheel of the robot
| |||
void | right () const | ||
turn right about the center of the robot
| |||
void | pivotRight () const | ||
turn right about the right wheel of the robot
| |||
void | forward (const int s) const | ||
move forward at speed {s}
| |||
void | reverse (const int s) const | ||
move reverse (go backwards) at speed {s}
| |||
void | left (const int s) const | ||
turn left at speed {s}
| |||
void | pivotLeft (const int s) const | ||
turn left at speed {s} but pivot around left wheel
| |||
void | right (const int s) const | ||
turn right at speed {s}
| |||
void | pivotRight (const int s) const | ||
turn right at speed {s} but pivot around right wheel
| |||
void | brake (const int ms) const | ||
apply the brakes to both motors then delay for {ms} mSec
|
Definition at line 57 of file MotorPair.H.
|
the minimum and maximum speeds a motor can go, its limits.
Definition at line 167 of file MotorPair.H. |
|
define a pair of motors specifying the connection of each to the RCX.
Definition at line 62 of file MotorPair.H. References Motor::Port. |
|
destroy this MotorPair instance
Definition at line 67 of file MotorPair.H. |
|
apply the brakes to both motors then delay for {ms} mSec
Definition at line 164 of file MotorPair.H. |
|
stop without coasting.
Definition at line 94 of file MotorPair.H. References Motor::direction(). Referenced by brake(). |
|
set the direction of our two motors
Definition at line 74 of file MotorPair.H. References Motor::direction(), and MotorDirection. |
|
move forward at speed {s}
Definition at line 136 of file MotorPair.H. |
|
move forward.
Definition at line 88 of file MotorPair.H. References direction(). Referenced by forward(). |
|
turn left at speed {s}
Definition at line 145 of file MotorPair.H. |
|
turn left about the center of the robot
Definition at line 107 of file MotorPair.H. References Motor::direction(). Referenced by left(). |
|
stop but allow coasting.
Definition at line 100 of file MotorPair.H. References Motor::direction(). |
|
turn left at speed {s} but pivot around left wheel
Definition at line 150 of file MotorPair.H. |
|
turn left about the left wheel of the robot
Definition at line 114 of file MotorPair.H. References Motor::brake(), and Motor::direction(). Referenced by pivotLeft(). |
|
turn right at speed {s} but pivot around right wheel
Definition at line 160 of file MotorPair.H. References pivotRight(), and speed(). |
|
turn right about the right wheel of the robot
Definition at line 128 of file MotorPair.H. References Motor::brake(), and Motor::direction(). Referenced by pivotRight(). |
|
move reverse (go backwards) at speed {s}
Definition at line 140 of file MotorPair.H. |
|
move reverse.
Definition at line 91 of file MotorPair.H. References direction(). Referenced by reverse(). |
|
turn right at speed {s}
Definition at line 155 of file MotorPair.H. |
|
turn right about the center of the robot
Definition at line 121 of file MotorPair.H. References Motor::direction(). Referenced by right(). |
|
set the speed of our two motors.
Definition at line 70 of file MotorPair.H. References Motor::speed(). Referenced by forward(), left(), pivotLeft(), pivotRight(), reverse(), and right(). |
brickOS is released under the
Mozilla Public License.
Original code copyright 1998-2002 by the authors. |