|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lejos.nxt.addon.tetrix.TetrixMotor lejos.nxt.addon.tetrix.TetrixEncoderMotor
public class TetrixEncoderMotor
Tetrix DC motor abstraction with encoder support. The Tetrix motor must have an encoder installed and connected to
the controller for the methods in this class to work. If an encoder is not installed, use the
class instead.
TetrixMotor
Use
to retrieve a TetrixMotorController.getEncoderMotor(int)
TetrixEncoderMotor
instance.
Method Summary | |
---|---|
int |
getLimitAngle()
Return the last angle that this motor was rotating to via one of the rotate methods. |
int |
getTachoCount()
Returns the tachometer count. |
void |
resetTachoCount()
Reset the the tachometer count. |
void |
rotate(int degrees,
boolean immediateReturn)
Rotate by the requested number of degrees with option for wait until completion or immediate return where the motor completes its rotation asynchronously. |
void |
rotateTo(int limitAngle,
boolean immediateReturn)
Rotate to the target angle with option for wait until completion or immediate return where the motor completes its rotation asynchronously. |
void |
setRegulate(boolean regulate)
Disable or Enable internal motor controller speed regulation. |
Methods inherited from class lejos.nxt.addon.tetrix.TetrixMotor |
---|
backward, flt, forward, getPower, isMoving, setPower, setReverse, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public int getTachoCount()
Encoder
getTachoCount
in interface Encoder
public void resetTachoCount()
resetTachoCount
in interface Encoder
public void rotate(int degrees, boolean immediateReturn)
degrees
- number of degrees to rotate relative to the current position.immediateReturn
- if true
, do not wait for the move to complete. false
will block
until the rotation completes.public void rotateTo(int limitAngle, boolean immediateReturn)
limitAngle
- Angle [in degrees] to rotate to.immediateReturn
- if true
, do not wait for the move to complete. false
will block
until the rotation completes.public int getLimitAngle()
public 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, false
otherwise.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |