User Tools

Site Tools


built_in:nxt

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
built_in:nxt [2015/03/21 18:27]
madlyr [Table]
built_in:nxt [2015/04/18 18:02] (current)
Line 13: Line 13:
 | [[nxt_brake|Brake( motors )]]                             | Commands the NXT brick to Brake one or more of it's motors.\\ The **motors** parameter can be a single motor, for example just "A" or a combination of motors such as "ABC".\\ Unlike the [[nxt_stop|Stop]] function, this function actively brakes the motors using power from the battery.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | | [[nxt_brake|Brake( motors )]]                             | Commands the NXT brick to Brake one or more of it's motors.\\ The **motors** parameter can be a single motor, for example just "A" or a combination of motors such as "ABC".\\ Unlike the [[nxt_stop|Stop]] function, this function actively brakes the motors using power from the battery.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
 | [[nxt_checkconnection|CheckConnection()]]                 | Returns true if the NXT brick is currently connected to the phone/tablet but it will show a popup warning message and return false if no brick is currently connected.\\ This function is useful if you want to warn the user that he/she have no connection.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | [[nxt_checkconnection|CheckConnection()]]                 | Returns true if the NXT brick is currently connected to the phone/tablet but it will show a popup warning message and return false if no brick is currently connected.\\ This function is useful if you want to warn the user that he/she have no connection.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
-| [[nxt_connect|Connect( p1 )]]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |+| [[nxt_connect|Connect( name )]]                           Connects to the Bluetooth device with given **name**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
 | [[nxt_disconnect|Disconnect()]]                           | Disconnects the Bluetooth link between your phone and the NXT brick.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | | [[nxt_disconnect|Disconnect()]]                           | Disconnects the Bluetooth link between your phone and the NXT brick.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
 | [[nxt_drive|Drive( motors, power, rotation )]]            | Commands the NXT brick to drive one or more of it's motors with a given power and number of rotations.\\ The **motors** parameter can be a single motor, for example just "A" or a combination of motors such as "ABC".\\ **Power** is given as a percentage value and negative values make the motor reverse.\\ If the number of **rotations** is set to zero, then the motor will continue until the Stop function is called.                                                                                                                                                                                                                                                                                                                                                     | | [[nxt_drive|Drive( motors, power, rotation )]]            | Commands the NXT brick to drive one or more of it's motors with a given power and number of rotations.\\ The **motors** parameter can be a single motor, for example just "A" or a combination of motors such as "ABC".\\ **Power** is given as a percentage value and negative values make the motor reverse.\\ If the number of **rotations** is set to zero, then the motor will continue until the Stop function is called.                                                                                                                                                                                                                                                                                                                                                     |
Line 21: Line 21:
 | [[nxt_getbtname|GetBtName( obj )]]                        | Returns Bluetooth name of a connected NXT brick or NXT brick name given as optional **obj** parameter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | | [[nxt_getbtname|GetBtName( obj )]]                        | Returns Bluetooth name of a connected NXT brick or NXT brick name given as optional **obj** parameter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
 | [[nxt_getcurrentprogram|GetCurrentProgram()]]             | Gets the name of the NXT-G program currently running on the NXT brick.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | | [[nxt_getcurrentprogram|GetCurrentProgram()]]             | Gets the name of the NXT-G program currently running on the NXT brick.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
 +| [[nxt_getrotationcount|GetRotationCount( motor)]]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
 | [[nxt_isbluetoothenabled|IsBluetoothEnabled()]]           | Checks if Bluetooth is enabled on the phone/tablet. Returns **true** if Bluetooth is enabled and **false** if it is disabled. This is alias for function IsEnabled.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | | [[nxt_isbluetoothenabled|IsBluetoothEnabled()]]           | Checks if Bluetooth is enabled on the phone/tablet. Returns **true** if Bluetooth is enabled and **false** if it is disabled. This is alias for function IsEnabled.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
 | [[nxt_isconnected|IsConnected()]]                         | Returns true if the NXT brick is currently connected to the phone/tablet. Unlike [[nxt_checkconnection|CheckConnection]] method, it will **not show a popup warning message** and return false if no brick is currently connected.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | | [[nxt_isconnected|IsConnected()]]                         | Returns true if the NXT brick is currently connected to the phone/tablet. Unlike [[nxt_checkconnection|CheckConnection]] method, it will **not show a popup warning message** and return false if no brick is currently connected.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
 | IsEnabled()                                               | Checks if Bluetooth is enabled on the phone/tablet. Returns **true** if Bluetooth is enabled and **false** if it is disabled. This is the same function as [[nxt_isbluetoothenabled|IsBluetoothEnabled]].                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | | IsEnabled()                                               | Checks if Bluetooth is enabled on the phone/tablet. Returns **true** if Bluetooth is enabled and **false** if it is disabled. This is the same function as [[nxt_isbluetoothenabled|IsBluetoothEnabled]].                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
 | [[nxt_ismotoridle|IsMotorIdle( motor )]]                  | Checks if the specified **motor** ("A","B","C") is currently powered. This can be useful in order to check if a previously sent motor command has completed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | | [[nxt_ismotoridle|IsMotorIdle( motor )]]                  | Checks if the specified **motor** ("A","B","C") is currently powered. This can be useful in order to check if a previously sent motor command has completed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
-| [[nxt_ispaired|IsPaired( p1 )]]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |+| [[nxt_ispaired|IsPaired( name )]]                         Checks if Bluetooth device with **name** is on the paired devices list of our phone/tablet. Returns "true" or "false"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
 | [[nxt_playsoundfile|PlaySoundFile( file, repeat )]]       | Commands the NXT brick to play a sound file (.rso) file which is available on the brick.\\ The **file** parameter should be the name of the sound file and the **repeat** parameter should be number of times you want the sound to repeat.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | | [[nxt_playsoundfile|PlaySoundFile( file, repeat )]]       | Commands the NXT brick to play a sound file (.rso) file which is available on the brick.\\ The **file** parameter should be the name of the sound file and the **repeat** parameter should be number of times you want the sound to repeat.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
 | [[nxt_readcolorsensor|ReadColorSensor( input, mode )]]    | Reads the color currently being 'seen' by the NXT color sensor. (Note: brick firmware 1.28 or greater is required for this function)\\ The **input** parameter should be an NXT input port number between 1 and 4 (which the color sensor is plugged into).\\ The **mode** parameter should be one of the following values:- "ColorDetect", "LightSense", "RedSense", "GreenSense", "BlueSense".\\ If the mode ColorDetect is chosen, then the returned values will be a number between 1 and 6 which represent the following colors: black, blue, green, yellow, red, white.\\ You can use the ToColorName function to convert from these six values to a color name.\\ If any of the other modes are chosen, then the result will be a color intensity value between 0 and 1023.  | | [[nxt_readcolorsensor|ReadColorSensor( input, mode )]]    | Reads the color currently being 'seen' by the NXT color sensor. (Note: brick firmware 1.28 or greater is required for this function)\\ The **input** parameter should be an NXT input port number between 1 and 4 (which the color sensor is plugged into).\\ The **mode** parameter should be one of the following values:- "ColorDetect", "LightSense", "RedSense", "GreenSense", "BlueSense".\\ If the mode ColorDetect is chosen, then the returned values will be a number between 1 and 6 which represent the following colors: black, blue, green, yellow, red, white.\\ You can use the ToColorName function to convert from these six values to a color name.\\ If any of the other modes are chosen, then the result will be a color intensity value between 0 and 1023.  |
built_in/nxt.1426962424.txt.gz ยท Last modified: 2015/03/22 02:27 (external edit)