|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RegulatedMotor
Interface for encoded motors without limited range of movement (e.g. NXT motor). TODO: Alternate names: EncodedMotor,EncoderMotor.
Method Summary | |
---|---|
void |
addListener(RegulatedMotorListener listener)
Adds a listener object that will be notified when rotation has started or stopped |
void |
flt(boolean immediateReturn)
Set the motor into float mode. |
int |
getLimitAngle()
Return the limit angle (if any) |
float |
getMaxSpeed()
Returns the maximim speed of the motor. |
int |
getSpeed()
Returns the current motor speed. |
boolean |
isStalled()
returns true if motor is stalled |
RegulatedMotorListener |
removeListener()
Removes the RegulatedMotorListener from this class. |
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 |
setAcceleration(int acceleration)
Set the required rate of acceleration degrees/s/s |
void |
setSpeed(int speed)
Set motor speed. |
void |
setStallThreshold(int error,
int time)
Set the parameters for detecting a stalled motor. |
void |
stop(boolean immediateReturn)
Causes motor to stop, pretty much instantaneously. |
void |
waitComplete()
Wait until the current movement operation is complete (this can include the motor stalling). |
Methods inherited from interface lejos.robotics.BaseMotor |
---|
backward, flt, forward, isMoving, stop |
Methods inherited from interface lejos.robotics.Tachometer |
---|
getRotationSpeed |
Methods inherited from interface lejos.robotics.Encoder |
---|
getTachoCount, resetTachoCount |
Method Detail |
---|
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 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.int getLimitAngle()
void setSpeed(int speed)
speed
- in degrees per second.int getSpeed()
float getMaxSpeed()
boolean isStalled()
void setStallThreshold(int error, int time)
error
- The error thresholdtime
- The time that the error threshold needs to be exceeded for.void setAcceleration(int acceleration)
acceleration
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |