|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectlejos.nxt.addon.tetrix.TetrixMotor
public class TetrixMotor
Tetrix basic DC motor abstraction without encoder support. The default power at instantiation is 100%.
Use to retrieve a TetrixMotorController.getBasicMotor(int)TetrixMotor instance.
| Method Summary | |
|---|---|
void |
backward()
Causes motor to rotate backwards until stop() or flt() is called. |
void |
flt()
Motor loses all power, causing the rotor to float freely to a stop. |
void |
forward()
Causes motor to rotate forward until stop() or flt() is called. |
int |
getPower()
Returns the current motor power setting. |
boolean |
isMoving()
Return true if the motor is moving. |
void |
setPower(int power)
Set the power level 0%-100% to be applied to the motor |
void |
setReverse(boolean reverse)
Used to alter the forward/reverse direction mapping for the motor output. |
void |
stop()
Causes motor to stop immediately. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public void setPower(int power)
DCMotor
setPower in interface DCMotorpower - new motor power 0-100public int getPower()
DCMotor
getPower in interface DCMotorpublic void forward()
BaseMotorstop() or flt() is called.
forward in interface BaseMotorpublic void backward()
BaseMotorstop() or flt() is called.
backward in interface BaseMotorpublic void stop()
BaseMotor
stop in interface BaseMotorpublic void flt()
BaseMotor
flt in interface BaseMotorpublic boolean isMoving()
true if the motor is moving. Note that this method reports based on the current control
state (i.e. commanded to move) and not if the motor is actually moving. This means a motor may be stalled but this
method would return true.
isMoving in interface BaseMotortrue if the motor is executing a movement command, false if stopped.public void setReverse(boolean reverse)
Changes to this setting take effect on the next motor command.
reverse - true to reverse direction mapping for this motor
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||