Documentation
  • Introduction
  • Components
    • User Interface
      • Button
      • Checkbox
      • Date Picker
      • Floating Button
      • Image
      • Label
      • List Picker
      • List View
      • List View Image and Text
      • Notifier
      • Radio Button
      • Rating Bar
      • Slider
      • Surface View
      • Spinner
      • Switch
      • TextBox
      • Time Picker
      • Web Viewer
    • Layout
      • Horizontal Arrangement
      • Horizontal Scroll Arrangement
      • Space
      • Table Arrangement
      • Vertical Arrangement
      • Vertical Scroll Arrangement
    • Media
      • Audio Picker
      • Camcorder
      • Camera
      • Image Picker
      • Metadata
      • OCR
      • Player
      • QR Code
      • Sound
      • Sound Recorder
      • Speech Recognizer
      • Text To Speech
      • Video Player
      • Yandex Translate
    • Drawing and Animation
      • Ball
      • Canvas
      • Image Editor
      • Image Sprite
    • Sensors
      • Accelerometer
      • Barcode Scanner
      • Clock
      • Finger Print
      • Gravity Sensor
      • Gyroscope Sensor
      • Light Sensor
      • Location Sensor
      • Magnetic Field Sensor
      • NearField
      • Orientation Sensor
      • Pedometer
      • Pressure Sensor
      • Proximity Sensor
      • Sound Sensor
      • Temperature Sensor
    • Social
      • Contact Picker
      • Email Picker
      • Google Account Picker
      • Phone Call
      • Phone Number Picker
      • Sharing
      • Texting
      • Twitter
    • Storage
      • File
      • Firebase DB
      • Fusiontables Control
      • SQLite
      • Tiny DB
      • Tiny Web DB
    • Connectivity
      • Activity Starter
      • Bluetooth Admin
      • Bluetooth Client
      • Bluetooth Server
      • Download
      • Network
      • Web
      • WiFi
    • Google
      • Google Account Picker
      • Google Maps
      • Google Shortlink
    • LEGO Mindstorms
      • NXT Drive
      • NXT Color Sensor
      • NXT Light Sensor
      • NXT Sound Sensor
      • NXT Touch Sensor
      • NXT Ultrasonic Sensor
      • NXT Direct Commands
      • EV3 Motors
      • EV3 Color Sensor
      • EV3 Gyro Sensor
      • EV3 Touch Sensor
      • EV3 Ultrasonic Sensor
      • EV3 Sound
      • EV3 UI
      • EV3 Commands
    • Monetization
      • AdMob Interstitial
      • AdMob Banner
      • AdMob Rewarded Video
      • Billing
      • Leadbolt
    • Device
      • Audio
      • Device Tools
      • Wallpaper
      • Package
      • Screenshot
    • Experimental
      • Push Notifications
      • Cloud DB
      • Notification
  • Blocks
    • Control
    • Logic
    • Math
    • Text
    • Lists
    • Colors
    • Variables
    • Procedures
    • Screen
    • Any Component
  • Testing
    • Live Development
      • Via WiFi
      • Via USB
    • Makeroid Companion
  • Extensions
    • List of Extensions
    • Creating Extensions
  • Other
    • Backpack
    • Release Notes
      • Andromeda
      • Beta Versions
    • Resources
      • Concept Cards
    • Terms of Service
Powered by GitBook
On this page
  • Properties
  • BluetoothClient
  • Methods
  • DeleteFile (text fileName)
  • DownloadFile (text source, text destination)
  • GetBatteryLevel ()
  • GetBrickName ()
  • GetCurrentProgramName ()
  • GetFirmwareVersion ()
  • GetInputValues (text sensorPortLetter)
  • GetOutputState (text motorPortLetter)
  • KeepAlive ()
  • ListFiles (text wildcard)
  • LsGetStatus (text sensorPortLetter)
  • LsRead (text sensorPortLetter)
  • LsWrite (text sensorPortLetter, list list, number rxDataLength)
  • MessageRead (number mailbox)
  • MessageWrite (number mailbox, text message)
  • PlaySoundFile (text fileName)
  • PlayTone (number frequencyHz, number durationMs)
  • ResetInputScaledValue (text sensorPortLetter)
  • ResetMotorPosition (text motorPortLetter, boolean relative)
  • SetBrickName (text name)
  • SetInputMode (text sensorPortLetter, number sensorType, number sensorMode)
  • SetOutputState (text motorPortLetter, number power, number mode, number regulationMode, number turnRatio, number runState, number tachoLimit)
  • StartProgram (text programName)
  • StopProgram ()
  • StopSoundPlayback ()
  1. Components
  2. LEGO Mindstorms

NXT Direct Commands

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

Properties

BluetoothClient

The BluetoothClient component that should be used for communication. Must be set in the Designer

Methods

DeleteFile (text fileName)

Delete a file on the robot.

DownloadFile (text source, text destination)

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 (text sensorPortLetter)

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

GetOutputState (text motorPortLetter)

Reads the output state of a motor on the robot.

KeepAlive ()

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

ListFiles (text wildcard)

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

LsGetStatus (text sensorPortLetter)

Returns the count of available bytes to read.

LsRead (text sensorPortLetter)

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

LsWrite (text sensorPortLetter, list list, number rxDataLength)

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

MessageRead (number mailbox)

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

MessageWrite (number mailbox, text message)

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

PlaySoundFile (text fileName)

Play a sound file on the robot.

PlayTone (number frequencyHz, number durationMs)

Make the robot play a tone.

ResetInputScaledValue (text sensorPortLetter)

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

ResetMotorPosition (text motorPortLetter, boolean relative)

Reset motor position.

SetBrickName (text name)

Set the brick name of the robot.

SetInputMode (text sensorPortLetter, number sensorType, number sensorMode)

Configure an input sensor on the robot.

SetOutputState (text motorPortLetter, number power, number mode, number regulationMode, number turnRatio, number runState, number tachoLimit)

Sets the output state of a motor on the robot.

StartProgram (text programName)

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.

PreviousNXT Ultrasonic SensorNextEV3 Motors

Last updated 7 years ago