Back

CreateNxtRemote

NxtRemote creates an NxtRemote object which allows user to control Lego Mindstorms NXT robot from the device via Bluetooth.

app.CreateNxtRemote() -> app object - NxtRemote

The following methods are avaiable on the NxtRemote object:

  Brake( motors )
  CheckConnection() -> boolean
  Connect( name )
  Destroy()
  FileFindFirst( pattern ) -> unknown
  FileFindNext( handle ) -> unknown
  GetBtAddress() -> string
  GetBtName() -> string
  GetCurrentProgram() -> string
  GetRotationCount( motor ) -> number - integer
  GetType() -> string - "Nxt"
  IsBluetoothEnabled() -> boolean
  IsConnected() -> boolean
  IsEnabled() -> boolean
  IsPaired( name ) -> boolean
  ReadColorSensor( input, mode ) -> number - 1..6
  ReadDistanceSensor( input ) -> number - float
  ReadLightSensor( input, active ) -> number - integer
  ReadMail( mailbox, type, remove ) -> string - or or
  ReadSoundSensor( input, mode ) -> number - float
  ReadTouchSensor( input ) -> boolean
  Release()
  Reset( motors )
  Stop( motors )
  ToColorName( val ) -> string - "black" or "blue" or "green" or "yellow" or "red" or "white"
  id -> string - "#id"

number - hertz
number - milliseconds
play tone with given frequency for a given time in millinum_seconds
string - "A" or "B" or "C"
stop feeding motors with power
check wether phone/tablet wa connected to the NXT
string
Connects to the Bluetooth device
destroys object
Disconnect NXT from Phone/Tablet
string - "A" or "B" or "C"
number - percent
number - float
unknown
commands NXT to drive motors
?
?
Returns Bluetooth address of connected NXT brick
Returns Bluetooth name of connected NXT
returns current running program name
string - "A" or "B" or "C"
GetRotationCount
IsBluetoothEnabled
IsConnected
IsEnabled
string - "A" or "B" or "C"
Checks if a motor is currently powered
string - path to file or folder ( "/absolute/..." or "relative/..." )
number - integer
PlaySoundFile for given times
number - 1..4
string - "ColorDetect" or "LightSense" or "RedSense" or "GreenSense" or "BlueSense"
ReadColorSensor with option: num_intensity value between 0 and 1023,without options: 1:black,2:blue,3:green,4:yellow,5:red,6:white
number - 1..4
ReadDistanceSensor in centimeters
number - 1..4
boolean
ReadLightSensor -> value between 0 and 100
number - int
string - "Text" or "Number" or "Logic"
ReadMail
number - 1..4
string - "DB" or "DbA"
ReadSoundSensor
number - 1..4
ReadTouchSensor
?
show enable bluetooth dialog when bluetooth disabled
string - "A" or "B" or "C"
Reset motors
number - 1..10
string - "Text" or "Number" or "Logic"
string - or integer or
SendMail
inverts direction of motor commands
number - 1..4
string -
  hexadecimal: "#rrggbb", "#aarrggbb"
  colourName: "red", "green", ...
?
function( ? )
called when NXT has successfully connected via Bluetooth
function( ? )
called when NXT has successfully connected via Bluetooth
function( ? )
called when NXT has successfully connected via Bluetooth
show paired NXT list to connect to one via bluetooth
StartProgram
string - "A" or "B" or "C"
Stop
StopProgram
number - 1..6
convert str_col num_int got via ReadColorSensor to str_col name
object id