public class NxtMotor extends Object
Each operation sent to motors performed by NxtApplication thru NxtCommand
NxtCommand,
NxtApplication| Modifier and Type | Field and Description |
|---|---|
private int |
id |
| Constructor and Description |
|---|
NxtMotor(int id)
New motor c'tor
|
| Modifier and Type | Method and Description |
|---|---|
void |
forward()
Set the motor on
|
int |
getTachoCount()
Get the current motor's location
|
void |
resetTachoCount()
Reset the current motor's location to 0
|
void |
rotate(int count)
Rotate motor
|
void |
rotateTo(int limitAngle)
Rotate motor to specified location
|
void |
setSpeed(int speed)
Set motor's speed
|
public void setSpeed(int speed)
speed - Speed to setpublic void rotate(int count)
count - Degrees to rotatepublic void rotateTo(int limitAngle)
limitAngle - Degrees limit to rotatepublic void resetTachoCount()
public int getTachoCount()
public void forward()