|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlejos.nxt.remote.RemoteMotor
public class RemoteMotor
Motor class. Contains three instances of Motor. Usage: Motor.A.forward(500);
Field Summary | |
---|---|
byte |
turnRatio
|
Constructor Summary | |
---|---|
RemoteMotor(NXTCommand nxtCommand,
int id)
|
Method Summary | |
---|---|
void |
backward()
Causes motor to rotate backwards until stop is called. |
void |
flt()
Motor loses all power, causing the rotor to float freely to a stop. |
void |
forward()
Causes motor to rotate forward until stop is called. |
int |
getBlockTacho()
Deprecated. |
char |
getId()
Get the ID of the motor. |
int |
getPower()
Return the power that the motor is set to |
int |
getRotationCount()
Deprecated. |
int |
getRotationSpeed()
Returns the actual speed. |
int |
getSpeed()
Returns the current motor speed. |
int |
getTachoCount()
Returns the tachometer count. |
boolean |
isMoving()
Return if the motor is moving. |
boolean |
isRotating()
CURRENTLY NOT IMPLEMENTED! |
void |
regulateSpeed(boolean yes)
Turns speed regulation on/off. |
int |
resetBlockTacho()
Deprecated. |
void |
resetTachoCount()
Reset the tachometer count. |
void |
rotate(int count)
Causes motor to rotate by a specified angle. |
void |
rotate(int count,
boolean returnNow)
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 returnNow)
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 |
setPower(int power)
Sets the power of the motor |
void |
setRegulationMode(int mode)
This method determines if and how the motor will be regulated. |
void |
setSpeed(int speed)
Set motor speed. |
void |
smoothAcceleration(boolean yes)
Enables smoother acceleration. |
void |
stop()
Causes motor to stop immediately. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public byte turnRatio
Constructor Detail |
---|
public RemoteMotor(NXTCommand nxtCommand, int id)
Method Detail |
---|
public final char getId()
public void forward()
DCMotor
forward
in interface DCMotor
public void backward()
DCMotor
backward
in interface DCMotor
public void setSpeed(int speed)
TachoMotor
setSpeed
in interface TachoMotor
speed
- in degrees per second.public void setPower(int power)
power
- the power (-100 to +100)public int getSpeed()
TachoMotor
getSpeed
in interface TachoMotor
public int getPower()
public int getTachoCount()
Encoder
getTachoCount
in interface Encoder
@Deprecated public int getRotationCount()
@Deprecated public int getBlockTacho()
public void rotate(int count, boolean returnNow)
TachoMotor
rotate
in interface TachoMotor
count
- through which the motor will rotatereturnNow
- iff true, method returns immediately, thus allowing monitoring of sensors in the calling thread.TachoMotor.rotate(int, boolean)
public boolean isMoving()
DCMotor
isMoving
in interface DCMotor
public boolean isRotating()
public void rotate(int count)
TachoMotor
rotate
in interface TachoMotor
count
- by which the motor will rotate.public void setRegulationMode(int mode)
mode
- See NXTProtocol for enumerations: REGULATION_MODE_MOTOR_SYNC,
REGULATION_MODE_MOTOR_SPEED, REGULATION_MODE_IDLEpublic void rotateTo(int limitAngle)
TachoMotor
rotateTo
in interface TachoMotor
limitAngle
- to which the motor will rotate, and then stop (in degrees). Includes any positive or negative int, even values > 360.public void rotateTo(int limitAngle, boolean returnNow)
TachoMotor
rotateTo
in interface TachoMotor
limitAngle
- to which the motor will rotate, and then stop (in degrees). Includes any positive or negative int, even values > 360.returnNow
- iff true, method returns immediately, thus allowing monitoring of sensors in the calling thread.public void resetTachoCount()
Encoder
resetTachoCount
in interface Encoder
@Deprecated public int resetBlockTacho()
public void stop()
DCMotor
stop
in interface DCMotor
public void flt()
DCMotor
flt
in interface DCMotor
public void regulateSpeed(boolean yes)
TachoMotor
regulateSpeed
in interface TachoMotor
yes
- is true for speed regulation.public void smoothAcceleration(boolean yes)
TachoMotor
smoothAcceleration
in interface TachoMotor
yes
- is true for smooth acceleration.public int getRotationSpeed()
Tachometer
getRotationSpeed
in interface Tachometer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |