public class MMXMotor extends java.lang.Object implements EncoderMotor
Use the NXTMMX.getBasicMotor() factory method to retrieve an instance of this class.
NXTMMX,
MMXRegulatedMotor| 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.
|
int |
getTachoCount()
Returns the tachometer count.
|
boolean |
isMoving()
Return
true if the motor is moving. |
void |
resetTachoCount()
Reset the the tachometer count.
|
void |
setPower(int power)
Set the power level 0%-100% to be applied to the motor
|
void |
setRamping(boolean doRamping)
Sets speed ramping is enabled/disabled for this motor.
|
void |
setRegulate(boolean regulate)
Disable or Enable internal motor controller speed regulation.
|
void |
stop()
Causes motor to stop immediately.
|
public void setPower(int power)
DCMotorpublic void setRamping(boolean doRamping)
doRamping - true to enable, false to disablepublic int getPower()
DCMotorpublic void forward()
BaseMotorstop() or flt() is called.public void backward()
BaseMotorstop() or flt() is called.public void stop()
BaseMotorpublic void flt()
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.public int getTachoCount()
EncodergetTachoCount in interface Encoderpublic void resetTachoCount()
resetTachoCount in interface Encoderpublic void setRegulate(boolean regulate)
true will cause
the motor controller firmware to adjust the motor power to compensate for changing loads in order to maintain
a constant motor speed. Default at instantiation is false.regulate - true to enable regulation, true otherwise.