rcx.rcxdirect
Class Motors
java.lang.Object
rcx.rcxdirect.DirectSend
rcx.rcxdirect.Motors
public class Motors
- extends DirectSend
Abstraction for motors. To synchronize
all motors use method controlMotors
.
To set each motor's power, use
Example:
Motors.control(1, 3, 1, 7, 7, 7);
Method Summary |
static void |
control(int aMode,
int bMode,
int cMode,
int aPower,
int bPower,
int cPower)
Sets motor direction for each motor to a value between 1 and 4
(1=forward, 2=backward, 3=stop, 4=float)
and motor power to a value between 0 and 7 |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FORWARD
public static final int FORWARD
- See Also:
- Constant Field Values
BACKWARD
public static final int BACKWARD
- See Also:
- Constant Field Values
STOP
public static final int STOP
- See Also:
- Constant Field Values
FLOAT
public static final int FLOAT
- See Also:
- Constant Field Values
control
public static void control(int aMode,
int bMode,
int cMode,
int aPower,
int bPower,
int cPower)
- Sets motor direction for each motor to a value between 1 and 4
(1=forward, 2=backward, 3=stop, 4=float)
and motor power to a value between 0 and 7
- Parameters:
aMode
- mode 1=forward, 2=backward, 3=stop, 4=floatbMode
- mode 1=forward, 2=backward, 3=stop, 4=floatcMode
- mode 1=forward, 2=backward, 3=stop, 4=floataPower
- power value in the range [0-7].bPower
- power value in the range [0-7].cPower
- power value in the range [0-7].