public interface RegulatedMotor extends BaseMotor, EV3DevBaseMotor, Tachometer
Modifier and Type | Method and Description |
---|---|
void |
addListener(RegulatedMotorListener listener)
Adds a listener object that will be notified when rotation has started or stopped
|
void |
endSynchronization()
Complete a set of synchronized motors operations.
|
void |
flt(boolean immediateReturn)
Set the motor into float mode.
|
float |
getMaxSpeed()
Returns the maximum speed that can be maintained by the regulation system based upon the
current state of the battery.
|
int |
getSpeed()
Returns the current motors speed.
|
boolean |
isStalled()
returns true if motors is stalled
|
RegulatedMotorListener |
removeListener()
Removes the RegulatedMotorListener from this class.
|
void |
rotate(int angle)
Causes motors to rotate by a specified angle.
|
void |
rotate(int angle,
boolean immediateReturn)
causes motors to rotate through angle;
iff immediateReturn is true, method returns immediately and the motors stops by itself If any motors method is called before the limit is reached, the rotation is canceled. |
void |
rotateTo(int limitAngle)
Causes motors 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 motors to rotate to limitAngle;
if immediateReturn is true, method returns immediately and the motors stops by itself and getTachoCount should be within +- 2 degrees if the limit angle If any motors method is called before the limit is reached, the rotation is canceled. |
void |
setAcceleration(int acceleration)
Set the required rate of acceleration degrees/s/s
|
void |
setSpeed(int speed)
Set motors speed.
|
void |
startSynchronization()
Begin a set of synchronized motors operations
|
void |
stop(boolean immediateReturn)
Causes motor to stop, pretty much
instantaneously.
|
void |
synchronizeWith(RegulatedMotor[] syncList)
Specify a set of motors that should be kept in synchronization with this one.
|
void |
waitComplete()
Wait until the current movement operation is complete (this can include
the motor stalling).
|
brake, coast, hold
getRotationSpeed
getTachoCount, resetTachoCount
void addListener(RegulatedMotorListener listener)
listener
- RegulatedMotorListener removeListener()
void stop(boolean immediateReturn)
immediateReturn
- if true do not wait for the motor to actually stopvoid flt(boolean immediateReturn)
immediateReturn
- If true do not wait for the motor to actually stopvoid waitComplete()
void rotate(int angle, boolean immediateReturn)
angle
- through which the motors 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 motors will rotate.void rotateTo(int limitAngle)
limitAngle
- to which the motors 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 motors 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()
float getMaxSpeed()
boolean isStalled()
void setAcceleration(int acceleration)
acceleration
- void synchronizeWith(RegulatedMotor[] syncList)
syncList
- an array of motors to synchronize with.void startSynchronization()
void endSynchronization()