rcx
Class Motor

java.lang.Object
  |
  +--rcx.Motor

public class Motor
extends java.lang.Object

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

A

public static Motor A

B

public static Motor B

C

public static Motor C

MOTORS

public static Motor[] MOTORS
Constructor Detail

Motor

public Motor(char id,
             RCXPort port)
creates a motor where id is 'A', 'B' or 'C' for specified port

Method Detail

backward

public final void backward()

flt

public final void flt()
floats the motor (like stop() but it doesn't brake - keeps the wheels spinning freely)


forward

public final void forward()

getId

public final char getId()

getPower

public final int getPower()

isBackward

public final boolean isBackward()

isFloating

public final boolean isFloating()

isForward

public final boolean isForward()

isMoving

public final boolean isMoving()

isStopped

public final boolean isStopped()

reverseDirection

public final void reverseDirection()

setPort

public static void setPort(RCXPort port)
sets rcx port to use and creates the static instances A, B, and C


setPower

public final void setPower(int p)

stop

public final void stop()


Copyright 1998-2002 dario laverde