public class NxtTurtleRobot extends LegoRobot
LegoRobot.ClosingMode
Constructor and Description |
---|
NxtTurtleRobot()
Same as TurtleLegoRobot(ipAddress), but ask for the IP address
|
NxtTurtleRobot(java.lang.String ipAddress)
Same as TurtleLegoRobot(ipAddress, true)
|
NxtTurtleRobot(java.lang.String ipAddress,
boolean showPane)
Creates a turtle robot instance using a EV3 brick with given IP address.
|
Modifier and Type | Method and Description |
---|---|
NxtTurtleRobot |
backward(int steps)
Moves the turtle backward the given number of steps.
|
void |
exit()
Closes the communication and terminates the program.
|
NxtTurtleRobot |
forward(int steps)
Moves the turtle forward the given number of steps.
|
NxtGear |
getGear()
Returns the gear used as component of the turtle.
|
int |
getTurtleSpeed()
Returns the current turtle speed.
|
NxtTurtleRobot |
left(int angle)
Turns the turtle to the left for the given angle.
|
NxtTurtleRobot |
right(int angle)
Turns the turtle to the right for the given angle.
|
NxtTurtleRobot |
setTurtleSpeed(int speed)
Sets the turtle speed to the given value.
|
addButtonListener, addConnectionListener, addPart, clearDisplay, connect, connect, connect, disconnect, drawString, drawStringAt, getAbout, getBatteryLevel, getBrickGateVersion, getDataOutputStream, getDebugLevel, getHitButtonID, getInputStream, getIPAddress, getIPAddresses, getProperties, getVersion, isAutonomous, isButtonHit, isConnected, isDownHit, isEnterHit, isEscapeHit, isLeftHit, isRightHit, isRunning, isUpHit, playTone, reset, setLED, setVolume
public NxtTurtleRobot(java.lang.String ipAddress, boolean showPane)
ipAddress
- the IP address, e.g. 10.0.1.1showPane
- if true, an information pane is showed, where the turtle commands are listedpublic NxtTurtleRobot(java.lang.String ipAddress)
ipAddress
- the IP address, e.g. 10.0.1.1public NxtTurtleRobot()
public NxtGear getGear()
public NxtTurtleRobot setTurtleSpeed(int speed)
speed
- 0..100public int getTurtleSpeed()
public NxtTurtleRobot forward(int steps)
steps
- the number of steps to go.public NxtTurtleRobot backward(int steps)
steps
- the number of steps to go.public NxtTurtleRobot left(int angle)
angle
- the angle in degree to rotate.public NxtTurtleRobot right(int angle)
angle
- the angle in degree to rotate.