rcx
Class Motor

java.lang.Object
  extended by 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

Version:
2.1 Copyright 2002 Dario Laverde, under terms of GNU LGPL
Author:
Dario Laverde

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()
           
static void main(java.lang.String[] args)
           
 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
equals, 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

setPort

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


getId

public final char getId()

setPower

public final void setPower(int p)

forward

public final void forward()

isForward

public final boolean isForward()

backward

public final void backward()

isBackward

public final boolean isBackward()

reverseDirection

public final void reverseDirection()

getPower

public final int getPower()

isMoving

public final boolean isMoving()

isFloating

public final boolean isFloating()

stop

public final void stop()

isStopped

public final boolean isStopped()

flt

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


main

public static void main(java.lang.String[] args)