The command format of all the built-in plugins uses space to separate arguments.
In the documentation below, <word>
stands for a single word of text (without spaces, but it can have
hyphens and other punctuation), <number>
for an integer, and <boolean>
for the words true
or false
.
BEEP
PCKBD <word>
The argument is a name of a key, such as LEFT
or RIGHT
or TAB
, in
uppercase. There are many possible key names, which are really the
names of virtual keys under Windows. See
sivantoledo.nxt.keyboard.Keyboard.java for a full list (until we have a
list here).
This command causes the named key to be "pressed" on the PC, as if somebody actually clicked on the keyboard. The application in the foreground will receive the key event (that is, the key event is not delived to NXTender, but usually to some other application running on the PC).
Here is a demo program that sends left- and right-arrow commands, to control presentations.
PCMOUSE DX-DY <number>
<number>
: relative movement of the mouse in
pixels.PCMOUSE LEFT
: a single left click.PCMOUSE MIDDLE
: a single middle
click.PCMOUSE RIGHT
: a single right
click.JOYSTICK COMMANDS-ON <number>
:
Single-word commands that describe large changes and button presses
will be sent to the NXT through mailbox whose number is <number>
(in the range 1-10).JOYSTICK X-ON <number>
:
changes in the x-axis of the joystick will be sent as numbers to this
mailbox (the numbers will be in the range -100 to 100).JOYSTICK Y-ON <number>
:
same for the y axis (forward-backward).JOYSTICK Z-ON <number>
:
same for the z axis (handle twist in mine).JOYSTICK SLIDER-ON <number>
:
same for the slider (throttle in mine).JOYSTICK CLEAR
: Clears all the
joystick settings (mailbox assignments).JOYSTICK START
: Start sending
joystick changes to the NXT (they are not sent as soon as the NXT
configures the mailbox numbers).JOYSTICK CLEAR
: Stop sending
joystick changes.(This plugin is incomplete; it works, but I may still change it).
The demo program shows how to control a vehicle using this plugin. The program works with JenToo, or other robots in which the motors are used upside down, so that backward in the move block really means forward.
The plugin allows the NXT to open a radar-style window on the
PC and to draw dots on it.
RADAR OPEN
: opens the radar window.RADAR CLEAR
: clears any dots on
the radar window.RADAR CLOSE
: closes the radar
window.RADAR HIT <number>
<number>
: the first
number is an angle, in degrees, measured from the positive x-axis, and
the second is a distance. The radar windows only displays distances of
up up 254; larger distances are interpreted as "no hit in this
direction" and are not drawn at all (this is consistent with the
behavior of the ultrasonic-sensor block in NXT-G).The demo program performs a single scan. It works when the ultrasonic sensor is connected to port 4 adn the motor that controls it to port A, and when 5 rotations of the motor translate via gear reduction to a single rotation of the sensor. For other ratios, adjust the divisor in the divide block.
This plugin is designed for testing and performance measurements.
PING START
: clears all the statistics variables.PING
: the plugin increments the counter of received messages and the amount of received data.PING <anything>
: same as just PING
, as long as the <anything>
part is not one of the recognized commands. Used to test delivery of longer messages.PING ONCE
: the plugin responds with a single PONG
message to mailbox 1.PING MANY <number>
: the plugin sens many PONG
messages back to the NXT.PING END <number>
: the plugin prints out delivery statistics, assuming that the NXT sent the specified number of PING
messages.© 2006, Sivan Toledo