rcx.rcxdirect
Class Motors

java.lang.Object
  extended by rcx.rcxdirect.DirectSend
      extended by 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);
 


Field Summary
static int BACKWARD
           
static int FLOAT
           
static int FORWARD
           
static int STOP
           
 
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 rcx.rcxdirect.DirectSend
getStream, getTimeout, getTimeoutStatic, init, lastResult, lastResultStatic, sendToRCX
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Method Detail

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=float
bMode - mode 1=forward, 2=backward, 3=stop, 4=float
cMode - mode 1=forward, 2=backward, 3=stop, 4=float
aPower - power value in the range [0-7].
bPower - power value in the range [0-7].
cPower - power value in the range [0-7].