java.lang.Object | +--rcx.Motor
Motor - encapsulates access to RCX Motors
This class is based on leJOS's class of the same name
| Field Summary | |
static Motor |
A
|
static Motor |
B
|
static Motor |
C
|
static Motor[] |
MOTORS
|
| Constructor Summary | |
Motor(char id,
RCXPort port)
creates a motor where id is 'A', 'B' or 'C' for specified port |
|
| Method Summary | |
void |
backward()
|
void |
flt()
floats the motor (like stop() but it doesn't brake - keeps the wheels spinning freely) |
void |
forward()
|
char |
getId()
|
int |
getPower()
|
boolean |
isBackward()
|
boolean |
isFloating()
|
boolean |
isForward()
|
boolean |
isMoving()
|
boolean |
isStopped()
|
void |
reverseDirection()
|
static void |
setPort(RCXPort port)
sets rcx port to use and creates the static instances A, B, and C |
void |
setPower(int p)
|
void |
stop()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static Motor A
public static Motor B
public static Motor C
public static Motor[] MOTORS
| Constructor Detail |
public Motor(char id,
RCXPort port)
| Method Detail |
public final void backward()
public final void flt()
public final void forward()
public final char getId()
public final int getPower()
public final boolean isBackward()
public final boolean isFloating()
public final boolean isForward()
public final boolean isMoving()
public final boolean isStopped()
public final void reverseDirection()
public static void setPort(RCXPort port)
public final void setPower(int p)
public final void stop()