Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

include/c++/MotorPair.H File Reference

C++ MotorPair Class Interface. More...

#include <config.h>
#include <conio.h>
#include <c++/Motor.H>

Include dependency graph for MotorPair.H:

Go to the source code of this file.

Compounds

class  MotorPair
 \class MotorPair MotorPair.H c++/MotorPair.H Pair-of-motors control interface. Often our robots use two motors, one on either side, which should be controlled together as one. This class makes this simple by allowing the coder to treat the pair as a single motor. The two motors can be connected to any of the output ports. When creating an instance of this class, simply specify which two output ports are involved. The normal Motor methods speed(), direction(), forward(), reverse(), brake(), and off() still apply. This class adds two new types of control:
  • turning about the center (between the two wheels) [left(), right()]
  • turning while using one of the wheels as the center of rotation [pivotLeft() and pivotRight()].
Note:
both motors will be turned off when this class is destroyed.
See also:
The other control classes: Motor, Sound, Lamp.
More...



Detailed Description

C++ MotorPair Class Interface.

Author:
Pat Welch (legOS@mousebrains.com)
Defines interface to a pair of Motors to be treated as one unit

Definition in file MotorPair.H.


brickOS is released under the Mozilla Public License.
Original code copyright 1998-2002 by the authors.

Generated on Tue Dec 10 00:09:05 2002 for brickOS C++ by doxygen 1.2.15