Content:
- Properties
- Methods

The NXT object is used to manage the connection between your Android phone and the Lego Mindstorms NXT brick.

nxt = app.CreateNxt( ) → app object: Nxt

Note: This function is deprecated. Please install and visit the NXT-Docs from the Plugins page

Example - Basic click to expand contents 

Example - Auto Connect click to expand contents 

Example - Sensors click to expand contents 

Properties

The following properties are available on the Nxt object:

dataObject: { key, value }

Methods

The following methods are available on the Nxt object:

CheckConnection() → Boolean
FileFindFirst( pattern ) → String
FileFindNext( handle ) → String
GetBtAddress() → String
GetBtName() → String
GetCurrentProgram() → String
GetRotationCount( motor ) → Number: integer
GetType() → String: “Nxt”
IsBluetoothEnabled() → Boolean
IsConnected() → Boolean
IsEnabled() → Boolean
IsMotorIdle( motor ) → Boolean
IsPaired( name ) → Boolean
ReadColorSensor( input, mode? ) → Number: integer: 1..6 or 0..1023
ReadDistanceSensor( input ) → Number: float
ReadLightSensor( input, active? ) → Number: integer: 0..100
ReadMail( mailbox, type?, remove? ) → String
ReadSoundSensor( input, mode? ) → Number: float
ReadTouchSensor( input ) → Boolean
ToColorName( val ) → String: “black” or “blue” or “green” or “yellow” or “red” or “white”