NxtDirectCommands

Last Updated On 2021-07-16

Version 2MinSDK 7Tutorial Video

A component that provides a low-level interface to a LEGO MINDSTORMS NXT robot, with functions to send NXT Direct Commands.


Properties

You can set the below properties in the UI part of the builder.

  • BluetoothClient - it's a BluetoothClient value which is set to blank by default.

Block Properties

You can set the below blocks properties in the blocks section of the builder.


Methods

You can set the below method blocks in the blocks section of the builder.

DeleteFile

Delete a file on the robot.

DownloadFile

Download a file to the robot.

GetBatteryLevel

Get the battery level for the robot. Returns the voltage in millivolts.

GetBrickName

Get the brick name of the robot.

GetCurrentProgramName

Get the name of currently running program on the robot.

GetFirmwareVersion

Get the firmware and protocol version numbers for the robot as a list where the first element is the firmware version number and the second element is the protocol version number.

GetInputValues

Reads the values of an input sensor on the robot. Assumes sensor type has been configured via SetInputMode.

GetOutputState

Reads the output state of a motor on the robot.

KeepAlive

Keep Alive. Returns the current sleep time limit in milliseconds.

ListFiles

Returns a list containing the names of matching files found on the robot.

LsGetStatus

Returns the count of available bytes to read.

LsRead

Reads unsigned low speed data from an input sensor on the robot. Assumes sensor type has been configured via SetInputMode.

LsWrite

Writes low speed data to an input sensor on the robot. Assumes sensor type has been configured via SetInputMode.

MessageRead

Read a message from a mailbox (1-10) on the robot.

MessageWrite

Write a message to a mailbox (1-10) on the robot.

PlaySoundFile

Play a sound file on the robot.

PlayTone

Make the robot play a tone.

ResetInputScaledValue

Reset the scaled value of an input sensor on the robot.

ResetMotorPosition

Reset motor position.

SetBrickName

Set the brick name of the robot.

SetInputMode

Configure an input sensor on the robot.

SetOutputState

Sets the output state of a motor on the robot.

StartProgram

Start execution of a previously downloaded program on the robot.

StopProgram

Stop execution of the currently running program on the robot.

StopSoundPlayback

Stop sound playback.