public class TetrixMotor extends java.lang.Object implements DCMotor
Use
to retrieve a TetrixMotorController.getBasicMotor(int)
TetrixMotor
instance.
Modifier and Type | Method and Description |
---|---|
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.
|
public void setPower(int power)
DCMotor
public int getPower()
DCMotor
public void forward()
BaseMotor
stop()
or flt()
is called.public void backward()
BaseMotor
stop()
or flt()
is called.public void stop()
BaseMotor
public void flt()
BaseMotor
public 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
.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