
public interface RegulatedMotor extends BaseMotor, Tachometer, java.io.Closeable
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the port, the port can not be used after this call.
|
int |
getSpeed()
Returns the current motor speed.
|
boolean |
isStalled()
returns true if motor is stalled
|
void |
rotate(int angle)
Causes motor to rotate by a specified angle.
|
void |
rotate(int angle,
boolean immediateReturn)
causes motor to rotate through angle;
iff immediateReturn is true, method returns immediately and the motor stops by itself If any motor method is called before the limit is reached, the rotation is canceled. |
void |
rotateTo(int limitAngle)
Causes motor to rotate to limitAngle;
Then getTachoCount should be within +- 2 degrees of the limit angle when the method returns |
void |
rotateTo(int limitAngle,
boolean immediateReturn)
causes motor to rotate to limitAngle;
if immediateReturn is true, method returns immediately and the motor stops by itself and getTachoCount should be within +- 2 degrees if the limit angle If any motor method is called before the limit is reached, the rotation is canceled. |
void |
setSpeed(int speed)
Set motor speed.
|
getRotationSpeedgetTachoCount, resetTachoCountvoid rotate(int angle,
boolean immediateReturn)
angle - through which the motor will rotateimmediateReturn - iff true, method returns immediately, thus allowing monitoring of sensors in the calling thread.rotate(int, boolean)void rotate(int angle)
angle - by which the motor will rotate.void rotateTo(int limitAngle)
limitAngle - to which the motor will rotate, and then stop (in degrees). Includes any positive or negative int, even values > 360.void rotateTo(int limitAngle,
boolean immediateReturn)
limitAngle - to which the motor will rotate, and then stop (in degrees). Includes any positive or negative int, even values > 360.immediateReturn - iff true, method returns immediately, thus allowing monitoring of sensors in the calling thread.void setSpeed(int speed)
speed - in degrees per second.int getSpeed()
boolean isStalled()
void close()
close in interface java.lang.AutoCloseableclose in interface java.io.Closeable