public class TetrixEncoderMotor extends TetrixMotor implements Encoder
TetrixMotor
class instead.
Use
to retrieve a TetrixMotorController.getEncoderMotor(int)
TetrixEncoderMotor
instance.
Modifier and Type | Method and Description |
---|---|
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.
|
backward, flt, forward, getPower, isMoving, setPower, setReverse, stop
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.