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
- Version:
- 2.1
Copyright 2002 Dario Laverde, under terms of GNU LGPL
- Author:
- Dario Laverde
Constructor Summary |
Motor(char id,
RCXPort port)
creates a motor where id is 'A', 'B' or 'C' for specified port |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
A
public static Motor A
B
public static Motor B
C
public static Motor C
MOTORS
public static Motor[] MOTORS
Motor
public Motor(char id,
RCXPort port)
- creates a motor where id is 'A', 'B' or 'C' for specified port
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)