NXT vs Scribbler-Fluke Commands

From IPRE Wiki
Jump to: navigation, search

Equivalent Commands

Infrastructure

Scribbler-Fluke Command NXT Equivalent Function
from Myro import * from MyroNXT import* This command imports all the robot commands available in the library. We

will use this whenever we intend to write programs that use the robot.

init("PortName") init(“PortName”) This command establishes a wireless communication connection with the robot.

"PortName" is determined at the time you configured your software during installation. It is typically the word com followed by a number. For example, "com5". The double quotes (") are essential and required.

Movement

Scribbler-Fluke Command NXT Equivalent Function
backward(SPEED) backward(SPEED,SECONDS) backward(SPEED,SECONDS) Move backwards at SPEED (value in the range -1.0…1.0) for a time given in SECONDS, then stop.

For the NXT command, entering 0 for time will cause it to run indefinitely.

forward(SPEED) forward(SPEED,SECONDS) forward(SPEED,SECONDS) Move forwards at SPEED (value in the range -1.0…1.0) for a time given in SECONDS, then stop.

For the NXT command, entering 0 for time will cause it to run indefinitely.

motors(LEFT,RIGHT) motors(LEFT,RIGHT) Turn the left motor at LEFT speed and right motor at RIGHT speed (value in the

range -1.0…1.0).

translate(SPEED) translate(SPEED) Move in a straight line at SPEED (value in the range -1.0…1.0). Negative values

specify backward movement and positive values specify forward movement.

turnLeft(SPEED) turnLeft(SPEED,SECONDS) turnLeft(SPEED,SECONDS) Turn left at SPEED (value in the range -1.0..1.0) for a time given in seconds, then stops.

For the NXT command, entering 0 for time will cause it to run indefinitely.

turnRight(SPEED) turnRight(SPEED,SECONDS) turnRight(SPEED,SECONDS) Turn right at SPEED (value in the range -1.0..1.0) for a time given in seconds, then stops.

For the NXT command, entering 0 for time will cause it to run indefinitely.

rotate(SPEED) rotate(SPEED) Rotates at SPEED (value in the range -1.0…1.0). Negative values rotate right

(clockwise) and positive values rotate left (counter-clockwise).

move(TRANSLATE, ROTATE) move(TRANSLATE, ROTATE) Move at the TRANSLATE and ROTATE speeds (value in the range -1.0…1.0).
stop() stop() Stops the robot.

Sensors

Scribbler-Fluke Command NXT Equivalent Function
getLight(POSITION) getLight(PortNumber) Returns the current value in the <POSITION> light sensor. <POSITION> can either be one of 'left', 'center', 'right' or one of the numbers 0, 1, 2. The positions 0, 1,and 2 correspond to the left, center, and right sensors.

For the NXT command the port number must be 1-4 and the port must be initialized.

getObstacle(<POSITION>) getTouch(PortNumber) Returns the current value in the <POSITION> IR sensor. <POSITION> can either be one of 'left', ‘center’, or 'right' or one of the numbers 0, 1, or 2.

For the NXT command the sensor returns true if the sensor is pressed and false otherwise. The port number must be 1-4 and the port must be initialized.

senses() senses() Displays the robot’s sensor values in a window. The display is updated every

second.

[Full MyroNXT Refernce Manual] [Full Myro Refernce Manual]