|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lejos.nxt.BasicMotor
public abstract class BasicMotor
An abstraction for a motor without a tachometer, such as an RCX motor.
Field Summary | |
---|---|
protected BasicMotorPort |
_port
|
Constructor Summary | |
---|---|
BasicMotor()
|
Method Summary | |
---|---|
void |
backward()
Causes motor to rotate backwards. |
void |
flt()
Causes motor to float. |
void |
forward()
Causes motor to rotate forward. |
int |
getMode()
Returns the mode. |
int |
getPower()
Returns the current power setting. |
boolean |
isBackward()
Return true if motor is backward. |
boolean |
isFloating()
Returns true iff the motor is in float mode. |
boolean |
isForward()
Return true if motor is forward. |
boolean |
isMoving()
Returns true iff the motor is in motion. |
boolean |
isStopped()
Return true if motor is stopped. |
void |
reverseDirection()
Reverses direction of the motor. |
void |
setPower(int power)
Sets power. |
void |
stop()
Causes motor to stop, pretty much instantaneously. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected BasicMotorPort _port
Constructor Detail |
---|
public BasicMotor()
Method Detail |
---|
public void setPower(int power)
power
- power setting: 0 - 100public int getPower()
public void forward()
forward
in interface DCMotor
public boolean isForward()
public void backward()
backward
in interface DCMotor
public boolean isBackward()
public void reverseDirection()
public boolean isMoving()
isMoving
in interface DCMotor
public void flt()
flt
in interface DCMotor
public boolean isFloating()
public void stop()
stop
in interface DCMotor
public boolean isStopped()
public int getMode()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |