NKH.MindSqualls Namespace

MindSqualls v1.1 documentation
NKH.MindSqualls Namespace
Namespaces > NKH.MindSqualls
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Contains classes for communicating with a LEGO MINDSTORMS NXT robot; bluetooth connection, the brick itself, motors and sensors.

Syntax
C# Visual Basic Managed C++
namespace NKH.MindSqualls
Namespace NKH.MindSqualls
namespace NKH.MindSqualls
Types
All Types Classes Structures Interfaces Enumerations Delegates
Icon | Type | Description
public class | HiTechnicColorSensor | Class representing the Color sensor from HiTechnic: http://www.hitechnic.com
public class | HiTechnicCompassSensor | Class representing the Compass sensor from HiTechnic: http://www.hitechnic.com
public class | NxtActiveSensor | According to the LEGO MINDSTORMS NXT Hardware Developer Kit p. 7, sensors is divided into three types: active sensors (e.g. Robotics Invention Systems sensors), passive sensors (e.g. the NXT touch, light, and sound sensors), and digital sensors (e.g. the NXT ultrasonic sensor and the HiTechnic compass sensor). The three abstract classes NxtActiveSensor, NxtPassiveSensor, and NxtDigitalSensor reflect this.
public class | NxtBluetoothConnection | Class representing the bluetooth protocol.
public class | NxtBrick | Class representing the NXT brick.
public enumeration | NxtCommand | Commands to the NXT brick.
public class | NxtCommunicationProtocol | Abstract class representing the NXT communication protocol.
public class | NxtCommunicationProtocolException | Exception thrown when there is an error in the communication to the NXT brick.
public class | NxtDigitalSensor | Abstract class representing a Digital sensor, i.e. a sensor using the I2C protocol.
public enumeration | NxtErrorMessage | ERROR MESSAGE BACK TO THE HOST
public class | NxtException | Generic NXT exception.
public structure | NxtFindFileReply | Reply type for the FindFirst() and FindNext() functions.
public structure | NxtGetDeviceInfoReply | Reply type for the GetDeviceInfo() function.
public structure | NxtGetFirmwareVersionReply | Reply type for the GetFirmwareVersion() function.
public structure | NxtGetInputValuesReply | Reply type for the GetInputValues() function.
public structure | NxtGetOutputStateReply | Reply type for the GetOutputState() function.
public class | NxtLightSensor | Class representing the Light sensor.
public enumeration | NxtMailbox | Reference: BDK, Appendix 2, p. 9.
public enumeration | NxtMailbox2 | Reference: BDK, Appendix 2, p. 9. Reference: BDK, Appendix 2, p. 11. (see MessageRead() function).
public class | NxtMotor | Class representing a motor.
public delegate | NxtMotorEvent | Delegate used for the NXT-G like events implemented in the motor.
public enumeration | NxtMotorMode | Reference: BDK, Appendix 2, p. 6.
public enumeration | NxtMotorPort | Reference: BDK, Appendix 2, p. 6.
public enumeration | NxtMotorRegulationMode | Reference: BDK, Appendix 2, p. 6.
public enumeration | NxtMotorRunState | Reference: BDK, Appendix 2, p. 6.
public class | NxtMotorSync | Class representing a synchronized pair of motors.
public class | NxtNoSensor | Class representing a port with no sensor attached.
public structure | NxtOpenAppendDataReply | Reply type for the OpenAppendData() function.
public structure | NxtOpenReadReply | Reply type for the OpenRead() function.
public class | NxtPassiveSensor | Abstract class representing a Passive Sensor.
public class | NxtPollable | Abstract class used as superclass for the NxtMotor and NxtSensor classes.
public structure | NxtRequestModuleReply | Reply type for the RequestFirstModule() and RequestNextModule() functions.
public class | NxtSensor | Superclass representing a generic sensor.
public delegate | NxtSensorEvent | Delegate used for the NXT-G like events implemented in the various sensors.
public enumeration | NxtSensorMode | Reference: BDK, Appendix 2, p. 7.
public enumeration | NxtSensorPort | Reference: BDK, Appendix 2, p. 7.
public enumeration | NxtSensorType | Reference: BDK, Appendix 2, p. 7.
public class | NxtSoundSensor | Class representing the Sound sensor.
public class | NxtTouchSensor | Class representing the Touch sensor.
public class | NxtUltrasonicSensor | Class representing the Ultrasonic sensor.
public delegate | Polled | Delegate used when a motor or sensor is polled.

Send comments on this topic to niels@mindsqualls.net

This code is released under the GPL v2 copyleft license


HiTechnicColorSensor Class

HiTechnicColorSensor Class
Namespaces > NKH.MindSqualls > HiTechnicColorSensor
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Class representing the Color sensor from HiTechnic: http://www.hitechnic.com

Syntax
C# Visual Basic Managed C++
public class HiTechnicColorSensor : NxtDigitalSensor
Public Class HiTechnicColorSensor _
    Inherits NxtDigitalSensor
public ref class HiTechnicColorSensor : public NxtDigitalSensor
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | HiTechnicColorSensorNew() | Constructor.
 | BlueReading() | Returns the current detection level for the color blue.
 | ColorIndexNumber() | Returns a single 6 bit number color index. Bits 5 and 4 encode the red signal level, bits 3 and 2 encode the green signal level and bits 1 and 0 encode the blue signal levels.
 | ColorNumber | Returns a single number color estimate.
 | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | GetHashCode() | Serves as a hash function for a particular type. GetHashCode() is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object.)
 | GetType() | Gets the Type of the current instance. (Inherited from Object.)
 | GreenReading() | Returns the current detection level for the color green.
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | NormalizedBlueReading() | Return the current relative level for the blue color component.
 | NormalizedGreenReading() | Return the current relative level for the green color component.
 | NormalizedRedReading() | Return the current relative level for the red color component.
 | OnPolled | This event is fired when the sensor, or motor, is polled. (Inherited from NxtPollable.)
 | Poll() | Poll the sensor/motor. (Inherited from NxtPollable.)
 | PollInterval | Indicates if the sensorm or motor, is auto-polled or not. (Inherited from NxtPollable.)
 | RawBlueSensorReading() | Returns the current sensor analog signal level for the color blue.
 | RawGreenSensorReading() | Returns the current sensor analog signal level for the color green.
 | RawRedSensorReading() | Returns the current sensor analog signal level for the color red.
 | ReadProductId() | Returns the name of the manufacturer, e.g. "LEGO". (Inherited from NxtDigitalSensor.)
 | ReadSensorType() | Returns the sensor type, e.g. "Sonar". (Inherited from NxtDigitalSensor.)
 | ReadVersion() | Returns the version of the sensor. (Inherited from NxtDigitalSensor.)
 | RedReading() | Returns the current detection level for the color red.
 | ToString() | Returns a String that represents the current Object. (Inherited from Object.)
Remarks

A special thanks to the people at HiTechnic for providing me with the necessary information.

Inheritance Hierarchy
Object
 | NxtPollable
 |  | NxtSensor
 |  |  | NxtDigitalSensor
 |  |  |  | HiTechnicColorSensor

Assembly: NKH.MindSqualls Version: 1.1.0.0 (Module: NKH.MindSqualls)


HiTechnicColorSensor Constructor

HiTechnicColorSensor Constructor
Namespaces > NKH.MindSqualls > HiTechnicColorSensor > HiTechnicColorSensorNew()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Constructor.

Syntax
C# Visual Basic Managed C++
public HiTechnicColorSensor ()
Public Sub New
public:
HiTechnicColorSensor ()


BlueReading Method

BlueReading Method
Namespaces > NKH.MindSqualls > HiTechnicColorSensor > BlueReading()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Returns the current detection level for the color blue.

Syntax
C# Visual Basic Managed C++
public byte BlueReading ()
Public Function BlueReading As Byte
public:
unsigned char BlueReading ()
Return Value
... TBD ...


ColorIndexNumber Method

ColorIndexNumber Method
Namespaces > NKH.MindSqualls > HiTechnicColorSensor > ColorIndexNumber()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Returns a single 6 bit number color index. Bits 5 and 4 encode the red signal level, bits 3 and 2 encode the green signal level and bits 1 and 0 encode the blue signal levels.

Syntax
C# Visual Basic Managed C++
public byte ColorIndexNumber ()
Public Function ColorIndexNumber As Byte
public:
unsigned char ColorIndexNumber ()
Return Value
... TBD ...


ColorNumber Property

ColorNumber Property
Namespaces > NKH.MindSqualls > HiTechnicColorSensor > ColorNumber
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Returns a single number color estimate.

Syntax
C# Visual Basic Managed C++
public byte ColorNumber { get; }
Public ReadOnly Property ColorNumber As Byte
public:
unsigned char ColorNumber {
    unsigned char get ();
}


GreenReading Method

GreenReading Method
Namespaces > NKH.MindSqualls > HiTechnicColorSensor > GreenReading()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Returns the current detection level for the color green.

Syntax
C# Visual Basic Managed C++
public byte GreenReading ()
Public Function GreenReading As Byte
public:
unsigned char GreenReading ()
Return Value
... TBD ...


NormalizedBlueReading Method

NormalizedBlueReading Method
Namespaces > NKH.MindSqualls > HiTechnicColorSensor > NormalizedBlueReading()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Return the current relative level for the blue color component.

Syntax
C# Visual Basic Managed C++
public byte NormalizedBlueReading ()
Public Function NormalizedBlueReading As Byte
public:
unsigned char NormalizedBlueReading ()
Return Value
... TBD ...
Remarks
The normalization sets the highest value of the three red, green and blue reading to 255 and adjusts the other two proportionately.


NormalizedGreenReading Method

NormalizedGreenReading Method
Namespaces > NKH.MindSqualls > HiTechnicColorSensor > NormalizedGreenReading()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Return the current relative level for the green color component.

Syntax
C# Visual Basic Managed C++
public byte NormalizedGreenReading ()
Public Function NormalizedGreenReading As Byte
public:
unsigned char NormalizedGreenReading ()
Return Value
... TBD ...
Remarks
The normalization sets the highest value of the three red, green and blue reading to 255 and adjusts the other two proportionately.


NormalizedRedReading Method

NormalizedRedReading Method
Namespaces > NKH.MindSqualls > HiTechnicColorSensor > NormalizedRedReading()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Return the current relative level for the red color component.

Syntax
C# Visual Basic Managed C++
public byte NormalizedRedReading ()
Public Function NormalizedRedReading As Byte
public:
unsigned char NormalizedRedReading ()
Return Value
... TBD ...
Remarks
The normalization sets the highest value of the three red, green and blue reading to 255 and adjusts the other two proportionately.


RawBlueSensorReading Method

RawBlueSensorReading Method
Namespaces > NKH.MindSqualls > HiTechnicColorSensor > RawBlueSensorReading()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Returns the current sensor analog signal level for the color blue.

Syntax
C# Visual Basic Managed C++
public ushort RawBlueSensorReading ()
Public Function RawBlueSensorReading As UShort
public:
unsigned short RawBlueSensorReading ()
Return Value
... TBD ...


RawGreenSensorReading Method

RawGreenSensorReading Method
Namespaces > NKH.MindSqualls > HiTechnicColorSensor > RawGreenSensorReading()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Returns the current sensor analog signal level for the color green.

Syntax
C# Visual Basic Managed C++
public ushort RawGreenSensorReading ()
Public Function RawGreenSensorReading As UShort
public:
unsigned short RawGreenSensorReading ()
Return Value
... TBD ...


RawRedSensorReading Method

RawRedSensorReading Method
Namespaces > NKH.MindSqualls > HiTechnicColorSensor > RawRedSensorReading()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Returns the current sensor analog signal level for the color red.

Syntax
C# Visual Basic Managed C++
public ushort RawRedSensorReading ()
Public Function RawRedSensorReading As UShort
public:
unsigned short RawRedSensorReading ()
Return Value
... TBD ...


RedReading Method

RedReading Method
Namespaces > NKH.MindSqualls > HiTechnicColorSensor > RedReading()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Returns the current detection level for the color red.

Syntax
C# Visual Basic Managed C++
public byte RedReading ()
Public Function RedReading As Byte
public:
unsigned char RedReading ()
Return Value
... TBD ...


HiTechnicCompassSensor Class

HiTechnicCompassSensor Class
Namespaces > NKH.MindSqualls > HiTechnicCompassSensor
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Class representing the Compass sensor from HiTechnic: http://www.hitechnic.com

Syntax
C# Visual Basic Managed C++
public class HiTechnicCompassSensor : NxtDigitalSensor
Public Class HiTechnicCompassSensor _
    Inherits NxtDigitalSensor
public ref class HiTechnicCompassSensor : public NxtDigitalSensor
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | HiTechnicCompassSensorNew() | Constructor.
 | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | GetHashCode() | Serves as a hash function for a particular type. GetHashCode() is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object.)
 | GetType() | Gets the Type of the current instance. (Inherited from Object.)
 | Heading | Heading
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | ModeControl() | Returns the current value of the mode control of the sensor.
 | OneDegreeAdder() | Returns an 1-degree adder to use with the TwoDegreeHeading()-method.
 | OnPolled | This event is fired when the sensor, or motor, is polled. (Inherited from NxtPollable.)
 | Poll() | Poll the sensor/motor. (Inherited from NxtPollable.)
 | PollInterval | Indicates if the sensorm or motor, is auto-polled or not. (Inherited from NxtPollable.)
 | ReadProductId() | Returns the name of the manufacturer, e.g. "LEGO". (Inherited from NxtDigitalSensor.)
 | ReadSensorType() | Returns the sensor type, e.g. "Sonar". (Inherited from NxtDigitalSensor.)
 | ReadVersion() | Returns the version of the sensor. (Inherited from NxtDigitalSensor.)
 | ToString() | Returns a String that represents the current Object. (Inherited from Object.)
 | TwoDegreeHeading() | Returns the current heading to a 2-degree accuracy.
Remarks

A special thanks to the people at HiTechnic for providing me with the necessary information.

Inheritance Hierarchy
Object
 | NxtPollable
 |  | NxtSensor
 |  |  | NxtDigitalSensor
 |  |  |  | HiTechnicCompassSensor


HiTechnicCompassSensor Constructor

HiTechnicCompassSensor Constructor
Namespaces > NKH.MindSqualls > HiTechnicCompassSensor > HiTechnicCompassSensorNew()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Constructor.

Syntax
C# Visual Basic Managed C++
public HiTechnicCompassSensor ()
Public Sub New
public:
HiTechnicCompassSensor ()


Heading Property

Heading Property
Namespaces > NKH.MindSqualls > HiTechnicCompassSensor > Heading
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Heading

Syntax
C# Visual Basic Managed C++
public ushort Heading { get; }
Public ReadOnly Property Heading As UShort
public:
unsigned short Heading {
    unsigned short get ();
}
Return Value


ModeControl Method

ModeControl Method
Namespaces > NKH.MindSqualls > HiTechnicCompassSensor > ModeControl()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Returns the current value of the mode control of the sensor.

Syntax
C# Visual Basic Managed C++
public byte ModeControl ()
Public Function ModeControl As Byte
public:
unsigned char ModeControl ()
Return Value
The value of the mode control


OneDegreeAdder Method

OneDegreeAdder Method
Namespaces > NKH.MindSqualls > HiTechnicCompassSensor > OneDegreeAdder()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Returns an 1-degree adder to use with the TwoDegreeHeading()-method.

Syntax
C# Visual Basic Managed C++
public byte OneDegreeAdder ()
Public Function OneDegreeAdder As Byte
public:
unsigned char OneDegreeAdder ()
Return Value
The adder


TwoDegreeHeading Method

TwoDegreeHeading Method
Namespaces > NKH.MindSqualls > HiTechnicCompassSensor > TwoDegreeHeading()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Returns the current heading to a 2-degree accuracy.

Syntax
C# Visual Basic Managed C++
public byte TwoDegreeHeading ()
Public Function TwoDegreeHeading As Byte
public:
unsigned char TwoDegreeHeading ()
Return Value
The heading


NxtActiveSensor Class

NxtActiveSensor Class
Namespaces > NKH.MindSqualls > NxtActiveSensor
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

According to the LEGO MINDSTORMS NXT Hardware Developer Kit p. 7, sensors is divided into three types: active sensors (e.g. Robotics Invention Systems sensors), passive sensors (e.g. the NXT touch, light, and sound sensors), and digital sensors (e.g. the NXT ultrasonic sensor and the HiTechnic compass sensor). The three abstract classes NxtActiveSensor, NxtPassiveSensor, and NxtDigitalSensor reflect this.

Syntax
C# Visual Basic Managed C++
public abstract class NxtActiveSensor : NxtSensor
Public MustInherit Class NxtActiveSensor _
    Inherits NxtSensor
public ref class NxtActiveSensor abstract : public NxtSensor
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | NxtActiveSensorNew(NxtSensorType, NxtSensorMode) | Constructor.
 | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | GetHashCode() | Serves as a hash function for a particular type. GetHashCode() is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object.)
 | GetType() | Gets the Type of the current instance. (Inherited from Object.)
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | OnPolled | This event is fired when the sensor, or motor, is polled. (Inherited from NxtPollable.)
 | Poll() | Poll the sensor/motor. (Inherited from NxtPollable.)
 | PollInterval | Indicates if the sensorm or motor, is auto-polled or not. (Inherited from NxtPollable.)
 | ToString() | Returns a String that represents the current Object. (Inherited from Object.)
Inheritance Hierarchy
Object
 | NxtPollable
 |  | NxtSensor
 |  |  | NxtActiveSensor
See Also
NxtPassiveSensor
NxtDigitalSensor


NxtActiveSensor Constructor (sensorType, sensorMode)

NxtActiveSensor Constructor (sensorType, sensorMode)
Namespaces > NKH.MindSqualls > NxtActiveSensor > NxtActiveSensorNew(NxtSensorType, NxtSensorMode)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Constructor.

Syntax
C# Visual Basic Managed C++
public NxtActiveSensor (
    NxtSensorType sensorType,
    NxtSensorMode sensorMode
)
Public Sub New ( _
    sensorType As NxtSensorType, _
    sensorMode As NxtSensorMode _
)
public:
NxtActiveSensor (
    NxtSensorType sensorType,
    NxtSensorMode sensorMode
)
Parameters
sensorType (NxtSensorType)
Sensor type
sensorMode (NxtSensorMode)
Sensor mode


NxtBluetoothConnection Class

NxtBluetoothConnection Class
Namespaces > NKH.MindSqualls > NxtBluetoothConnection
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Class representing the bluetooth protocol.

Syntax
C# Visual Basic Managed C++
public class NxtBluetoothConnection : NxtCommunicationProtocol
Public Class NxtBluetoothConnection _
    Inherits NxtCommunicationProtocol
public ref class NxtBluetoothConnection : public NxtCommunicationProtocol
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | NxtBluetoothConnectionNew(Byte) | Constructor.
 | BluetoothFactoryReset() | BLUETOOTH FACTORY RESET COMMAND (Inherited from NxtCommunicationProtocol.)
 | Boot() | BOOT COMMAND (Inherited from NxtCommunicationProtocol.)
 | Close(Byte) | CLOSE COMMAND (Inherited from NxtCommunicationProtocol.)
 | CloseModuleHandle(Byte) | CLOSE MODULE HANDLE COMMAND (Inherited from NxtCommunicationProtocol.)
 | Connect() | Connect via bluetooth. (Overrides NxtCommunicationProtocol.Connect().)
 | Delete(String) | DELETE COMMAND (Inherited from NxtCommunicationProtocol.)
 | DeleteUserFlash() | DELETE USER FLASH (Inherited from NxtCommunicationProtocol.)
 | Disconnect() | Disconnect. (Overrides NxtCommunicationProtocol.Disconnect().)
 | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | FindFirst(String) | FIND FIRST (Inherited from NxtCommunicationProtocol.)
 | FindNext(Byte) | FIND NEXT (Inherited from NxtCommunicationProtocol.)
 | GetBatteryLevel() | GETBATTERYLEVEL (Inherited from NxtCommunicationProtocol.)
 | GetCurrentProgramName() | GETCURRENTPROGRAMNAME (Inherited from NxtCommunicationProtocol.)
 | GetDeviceInfo() | GET DEVICE INFO (Inherited from NxtCommunicationProtocol.)
 | GetFirmwareVersion() | GET FIRMWARE VERSION (Inherited from NxtCommunicationProtocol.)
 | GetHashCode() | Serves as a hash function for a particular type. GetHashCode() is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object.)
 | GetInputValues(NxtSensorPort) | GETINPUTVALUES (Inherited from NxtCommunicationProtocol.)
 | GetOutputState(NxtMotorPort) | GETOUTPUTSTATE (Inherited from NxtCommunicationProtocol.)
 | GetType() | Gets the Type of the current instance. (Inherited from Object.)
 | IsConnected | Indicates if the NXT brick is connected. (Overrides NxtCommunicationProtocol.IsConnected.)
 | KeepAlive() | KEEPALIVE (Inherited from NxtCommunicationProtocol.)
 | LsGetStatus(NxtSensorPort) | LSGETSTATUS (Inherited from NxtCommunicationProtocol.)
 | LsRead(NxtSensorPort) | LSREAD (Inherited from NxtCommunicationProtocol.)
 | LsWrite(NxtSensorPort, Byte, Byte[]()) | LSWRITE (Inherited from NxtCommunicationProtocol.)
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | MessageRead(NxtMailbox2, NxtMailbox, Boolean) | MESSAGEREAD (Inherited from NxtCommunicationProtocol.)
 | MessageWrite(NxtMailbox, String) | MESSAGEWRITE (Inherited from NxtCommunicationProtocol.)
 | OpenAppendData(String) | OPEN APPEND DATA COMMAND (Inherited from NxtCommunicationProtocol.)
 | OpenRead(String) | OPEN READ COMMAND (Inherited from NxtCommunicationProtocol.)
 | OpenReadLinear(String) | OPEN READ LINEAR COMMAND (INTERNAL COMMAND) (Inherited from NxtCommunicationProtocol.)
 | OpenWrite(String, UInt32) | OPEN WRITE COMMAND (Inherited from NxtCommunicationProtocol.)
 | OpenWriteData(String, UInt32) | OPEN WRITE DATA COMMAND (Inherited from NxtCommunicationProtocol.)
 | OpenWriteLinear(String, UInt32) | OPEN WRITE LINEAR COMMAND (Inherited from NxtCommunicationProtocol.)
 | PlaySoundfile(Boolean, String) | PLAYSOUNDFILE (Inherited from NxtCommunicationProtocol.)
 | PlayTone(UInt16, UInt16) | PLAYTONE (Inherited from NxtCommunicationProtocol.)
 | PollCommand(Byte, Byte) | POLL COMMAND (Inherited from NxtCommunicationProtocol.)
 | PollCommandLength(Byte) | POLL COMMAND LENGTH (Inherited from NxtCommunicationProtocol.)
 | Read(Byte, UInt16) | READ COMMAND (Inherited from NxtCommunicationProtocol.)
 | ReadIoMap(UInt32, UInt16, UInt16) | READ IO MAP COMMAND (Inherited from NxtCommunicationProtocol.)
 | ReplyRequired | Flag indicating if a reply should always be recieved. (Inherited from NxtCommunicationProtocol.)
 | RequestFirstModule(String) | REQUEST FIRST MODULE (Inherited from NxtCommunicationProtocol.)
 | RequestNextModule(Byte) | REQUEST NEXT MODULE (Inherited from NxtCommunicationProtocol.)
 | ResetInputScaledValue(NxtSensorPort) | RESETINPUTSCALEDVALUE (Inherited from NxtCommunicationProtocol.)
 | ResetMotorPosition(NxtMotorPort, Boolean) | RESETMOTORPOSITION (Inherited from NxtCommunicationProtocol.)
 | SetBrickName(String) | SET BRICK NAME COMMAND (Inherited from NxtCommunicationProtocol.)
 | SetInputMode(NxtSensorPort, NxtSensorType, NxtSensorMode) | SETINPUTMODE (Inherited from NxtCommunicationProtocol.)
 | SetOutputState(NxtMotorPort, SByte, NxtMotorMode, NxtMotorRegulationMode, SByte, NxtMotorRunState, UInt32) | SETOUTPUTSTATE (Inherited from NxtCommunicationProtocol.)
 | StartProgram(String) | STARTPROGRAM (Inherited from NxtCommunicationProtocol.)
 | StopProgram() | STOPPROGRAM (Inherited from NxtCommunicationProtocol.)
 | StopSoundPlayback() | STOPSOUNDPLAYBACK (Inherited from NxtCommunicationProtocol.)
 | ToString() | Returns a String that represents the current Object. (Inherited from Object.)
 | Write(Byte, Byte[]()) | WRITE COMMAND (Inherited from NxtCommunicationProtocol.)
 | WriteIoMap(UInt32, UInt16, Byte[]()) | WRITE IO MAP COMMAND (Inherited from NxtCommunicationProtocol.)
Inheritance Hierarchy
Object
 | NxtCommunicationProtocol
 |  | NxtBluetoothConnection


NxtBluetoothConnection Constructor (serialPortNo)

NxtBluetoothConnection Constructor (serialPortNo)
Namespaces > NKH.MindSqualls > NxtBluetoothConnection > NxtBluetoothConnectionNew(Byte)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Constructor.

Syntax
C# Visual Basic Managed C++
public NxtBluetoothConnection (
    byte serialPortNo
)
Public Sub New ( _
    serialPortNo As Byte _
)
public:
NxtBluetoothConnection (
    unsigned char serialPortNo
)
Parameters
serialPortNo (Byte)
The COM port used by the Bluetooth link


Connect Method

Connect Method
Namespaces > NKH.MindSqualls > NxtBluetoothConnection > Connect()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Connect via bluetooth.

Syntax
C# Visual Basic Managed C++
public override void Connect ()
Public Overrides Sub Connect
public:
virtual void Connect () override


Disconnect Method

Disconnect Method
Namespaces > NKH.MindSqualls > NxtBluetoothConnection > Disconnect()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Disconnect.

Syntax
C# Visual Basic Managed C++
public override void Disconnect ()
Public Overrides Sub Disconnect
public:
virtual void Disconnect () override


IsConnected Property

IsConnected Property
Namespaces > NKH.MindSqualls > NxtBluetoothConnection > IsConnected
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Indicates if the NXT brick is connected.

Syntax
C# Visual Basic Managed C++
public override bool IsConnected { get; }
Public Overrides ReadOnly Property IsConnected As Boolean
public:
virtual bool IsConnected {
    bool get () override;
}


NxtBrick Class

NxtBrick Class
Namespaces > NKH.MindSqualls > NxtBrick
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Class representing the NXT brick.

Syntax
C# Visual Basic Managed C++
public class NxtBrick
Public Class NxtBrick
public ref class NxtBrick
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | NxtBrickNew(Byte) | Constructor.
 | BatteryLevel | The battery level of the NXT brick, millivolts.
 | CommLink | The bluetooth link.
 | Connect() | Connect to the NXT brick.
 | Disconnect() | Disconnect from the NXT brick.
 | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | GetHashCode() | Serves as a hash function for a particular type. GetHashCode() is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object.)
 | GetType() | Gets the Type of the current instance. (Inherited from Object.)
 | IsConnected | Indicates if the NXT brick is connected.
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | MotorA | The motor attached to port A.
 | MotorB | The motor attached to port B.
 | MotorC | The motor attached to port C.
 | Name | The name of the NXT brick.
 | PlaySoundfile(String) | Plays a sound file stored in the NXT brick.
 | PlayTone(UInt16, UInt16) | Plays a tone.
 | Program | This property returns the name of the currently running program, or the empty string if no program is running. Set the property to a program name to run the program.
 | Programs | The programs currently stored in the NXT brick.
 | Sensor1 | The sensor attached to port 1.
 | Sensor2 | The sensor attached to port 2.
 | Sensor3 | The sensor attached to port 3.
 | Sensor4 | The sensor attached to port 4.
 | Sounds | The sounds currently stored in the NXT brick.
 | StopSound() | Stop all playing sound, sound files and tones.
 | ToString() | Returns a String that represents the current Object. (Inherited from Object.)
Inheritance Hierarchy
Object
NxtBrick


NxtBrick Constructor (serialPortNo)

NxtBrick Constructor (serialPortNo)
Namespaces > NKH.MindSqualls > NxtBrick > NxtBrickNew(Byte)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Constructor.

Syntax
C# Visual Basic Managed C++
public NxtBrick (
    byte serialPortNo
)
Public Sub New ( _
    serialPortNo As Byte _
)
public:
NxtBrick (
    unsigned char serialPortNo
)
Parameters
serialPortNo (Byte)
The COM port used by the Bluetooth link


BatteryLevel Property

BatteryLevel Property
Namespaces > NKH.MindSqualls > NxtBrick > BatteryLevel
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The battery level of the NXT brick, millivolts.

Syntax
C# Visual Basic Managed C++
public ushort BatteryLevel { get; }
Public ReadOnly Property BatteryLevel As UShort
public:
unsigned short BatteryLevel {
    unsigned short get ();
}


CommLink Property

CommLink Property
Namespaces > NKH.MindSqualls > NxtBrick > CommLink
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The bluetooth link.

Syntax
C# Visual Basic Managed C++
public NxtCommunicationProtocol CommLink { get; }
Public ReadOnly Property CommLink As NxtCommunicationProtocol
public:
NxtCommunicationProtocol^ CommLink {
    NxtCommunicationProtocol^ get ();
}
Exceptions
Exception | Condition
NxtException | Throws a NxtException if not connected.
See Also
Connect()
Disconnect()
IsConnected


Connect Method

Connect Method
Namespaces > NKH.MindSqualls > NxtBrick > Connect()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Connect to the NXT brick.

Syntax
C# Visual Basic Managed C++
public void Connect ()
Public Sub Connect
public:
void Connect ()
See Also
CommLink
Disconnect()
IsConnected


Disconnect Method

Disconnect Method
Namespaces > NKH.MindSqualls > NxtBrick > Disconnect()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Disconnect from the NXT brick.

Syntax
C# Visual Basic Managed C++
public void Disconnect ()
Public Sub Disconnect
public:
void Disconnect ()
See Also
CommLink
Connect()
IsConnected


IsConnected Property

IsConnected Property
Namespaces > NKH.MindSqualls > NxtBrick > IsConnected
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Indicates if the NXT brick is connected.

Syntax
C# Visual Basic Managed C++
public bool IsConnected { get; }
Public ReadOnly Property IsConnected As Boolean
public:
bool IsConnected {
    bool get ();
}
See Also
CommLink
Connect()
Disconnect()


MotorA Property

MotorA Property
Namespaces > NKH.MindSqualls > NxtBrick > MotorA
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The motor attached to port A.

Syntax
C# Visual Basic Managed C++
public NxtMotor MotorA { get; set; }
Public Property MotorA As NxtMotor
public:
NxtMotor^ MotorA {
    NxtMotor^ get ();
    void set (NxtMotor^ value);
}


MotorB Property

MotorB Property
Namespaces > NKH.MindSqualls > NxtBrick > MotorB
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The motor attached to port B.

Syntax
C# Visual Basic Managed C++
public NxtMotor MotorB { get; set; }
Public Property MotorB As NxtMotor
public:
NxtMotor^ MotorB {
    NxtMotor^ get ();
    void set (NxtMotor^ value);
}


MotorC Property

MotorC Property
Namespaces > NKH.MindSqualls > NxtBrick > MotorC
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The motor attached to port C.

Syntax
C# Visual Basic Managed C++
public NxtMotor MotorC { get; set; }
Public Property MotorC As NxtMotor
public:
NxtMotor^ MotorC {
    NxtMotor^ get ();
    void set (NxtMotor^ value);
}


Name Property

Name Property
Namespaces > NKH.MindSqualls > NxtBrick > Name
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The name of the NXT brick.

Syntax
C# Visual Basic Managed C++
public string Name { get; set; }
Public Property Name As String
public:
String^ Name {
    String^ get ();
    void set (String^ value);
}


PlaySoundfile Method (soundFile)

PlaySoundfile Method (soundFile)
Namespaces > NKH.MindSqualls > NxtBrick > PlaySoundfile(String)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Plays a sound file stored in the NXT brick.

Syntax
C# Visual Basic Managed C++
public void PlaySoundfile (
    string soundFile
)
Public Sub PlaySoundfile ( _
    soundFile As String _
)
public:
void PlaySoundfile (
    String^ soundFile
)
Parameters
soundFile (String)
The sound file


PlayTone Method (frequency, duration)

PlayTone Method (frequency, duration)
Namespaces > NKH.MindSqualls > NxtBrick > PlayTone(UInt16, UInt16)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Plays a tone.

Syntax
C# Visual Basic Managed C++
public void PlayTone (
    ushort frequency,
    ushort duration
)
Public Sub PlayTone ( _
    frequency As UShort, _
    duration As UShort _
)
public:
void PlayTone (
    unsigned short frequency,
    unsigned short duration
)
Parameters
frequency (UInt16)
Frequency for the tone, Hz
duration (UInt16)
Duration of the tone, ms


Program Property

Program Property
Namespaces > NKH.MindSqualls > NxtBrick > Program
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

This property returns the name of the currently running program, or the empty string if no program is running.

Set the property to a program name to run the program.

Syntax
C# Visual Basic Managed C++
public string Program { get; set; }
Public Property Program As String
public:
String^ Program {
    String^ get ();
    void set (String^ value);
}


Programs Property

Programs Property
Namespaces > NKH.MindSqualls > NxtBrick > Programs
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The programs currently stored in the NXT brick.

Syntax
C# Visual Basic Managed C++
public string[] Programs { get; }
Public ReadOnly Property Programs As String()
public:
array<String^>^ Programs {
    array<String^>^ get ();
}


Sensor1 Property

Sensor1 Property
Namespaces > NKH.MindSqualls > NxtBrick > Sensor1
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The sensor attached to port 1.

Syntax
C# Visual Basic Managed C++
public NxtSensor Sensor1 { get; set; }
Public Property Sensor1 As NxtSensor
public:
NxtSensor^ Sensor1 {
    NxtSensor^ get ();
    void set (NxtSensor^ value);
}


Sensor2 Property

Sensor2 Property
Namespaces > NKH.MindSqualls > NxtBrick > Sensor2
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The sensor attached to port 2.

Syntax
C# Visual Basic Managed C++
public NxtSensor Sensor2 { get; set; }
Public Property Sensor2 As NxtSensor
public:
NxtSensor^ Sensor2 {
    NxtSensor^ get ();
    void set (NxtSensor^ value);
}


Sensor3 Property

Sensor3 Property
Namespaces > NKH.MindSqualls > NxtBrick > Sensor3
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The sensor attached to port 3.

Syntax
C# Visual Basic Managed C++
public NxtSensor Sensor3 { get; set; }
Public Property Sensor3 As NxtSensor
public:
NxtSensor^ Sensor3 {
    NxtSensor^ get ();
    void set (NxtSensor^ value);
}


Sensor4 Property

Sensor4 Property
Namespaces > NKH.MindSqualls > NxtBrick > Sensor4
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The sensor attached to port 4.

Syntax
C# Visual Basic Managed C++
public NxtSensor Sensor4 { get; set; }
Public Property Sensor4 As NxtSensor
public:
NxtSensor^ Sensor4 {
    NxtSensor^ get ();
    void set (NxtSensor^ value);
}


Sounds Property

Sounds Property
Namespaces > NKH.MindSqualls > NxtBrick > Sounds
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The sounds currently stored in the NXT brick.

Syntax
C# Visual Basic Managed C++
public string[] Sounds { get; }
Public ReadOnly Property Sounds As String()
public:
array<String^>^ Sounds {
    array<String^>^ get ();
}


StopSound Method

StopSound Method
Namespaces > NKH.MindSqualls > NxtBrick > StopSound()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Stop all playing sound, sound files and tones.

Syntax
C# Visual Basic Managed C++
public void StopSound ()
Public Sub StopSound
public:
void StopSound ()


NxtCommand Enumeration

NxtCommand Enumeration
Namespaces > NKH.MindSqualls > NxtCommand
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Commands to the NXT brick.

Syntax
C# Visual Basic Managed C++
public enum NxtCommand
Public Enumeration NxtCommand
public enum class NxtCommand
Members
Member | Description
StartProgram | BDK, Appendix 2, p. 5.
StopProgram | BDK, Appendix 2, p. 5.
PlaySoundfile | BDK, Appendix 2, p. 5.
PlayTone | BDK, Appendix 2, p. 6.
SetOutputState | BDK, Appendix 2, p. 6.
SetInputMode | BDK, Appendix 2, p. 7.
GetOutputState | BDK, Appendix 2, p. 8.
GetInputValues | BDK, Appendix 2, p. 8.
ResetInputScaledValue | BDK, Appendix 2, p. 8.
MessageWrite | BDK, Appendix 2, p. 9.
ResetMotorPosition | BDK, Appendix 2, p. 9.
GetBatteryLevel | BDK, Appendix 2, p. 9.
StopSoundPlayback | BDK, Appendix 2, p. 9.
KeepAlive | BDK, Appendix 2, p. 10.
LsGetStatus | BDK, Appendix 2, p. 10.
LsWrite | BDK, Appendix 2, p. 10.
LsRead | BDK, Appendix 2, p. 10.
GetCurrentProgramName | BDK, Appendix 2, p. 11.
MessageRead | BDK, Appendix 2, p. 11.
OpenRead | BDK, Appendix 1, p. 7.
OpenWrite | BDK, Appendix 1, p. 7.
Read | BDK, Appendix 1, p. 8.
Write | BDK, Appendix 1, p. 8.
Close | BDK, Appendix 1, p. 8.
Delete | BDK, Appendix 1, p. 9.
FindFirst | BDK, Appendix 1, p. 9.
FindNext | BDK, Appendix 1, p. 10.
GetFirmwareVersion | BDK, Appendix 1, p. 11.
OpenWriteLinear | BDK, Appendix 1, p. 11.
OpenReadLinear | BDK, Appendix 1, p. 12.
OpenWriteData | BDK, Appendix 1, p. 12.
OpenAppendData | BDK, Appendix 1, p. 13.
RequestFirstModule | BDK, Appendix 1, p. 19.
RequestNextModule | BDK, Appendix 1, p. 19.
CloseModuleHandle | BDK, Appendix 1, p. 20.
ReadIoMap | BDK, Appendix 1, p. 20.
WriteIoMap | BDK, Appendix 1, p. 21.
Boot | BDK, Appendix 1, p. 13.
SetBrickName | BDK, Appendix 1, p. 13.
GetDeviceInfo | BDK, Appendix 1, p. 14.
DeleteUserFlash | BDK, Appendix 1, p. 14.
PollCommandLength | BDK, Appendix 1, p. 15.
PollCommand | BDK, Appendix 1, p. 15.
BluetoothFactoryReset | BDK, Appendix 1, p. 15.
Remarks

Reference: BDK, Appendix 1 & 2.


NxtCommunicationProtocol Class

NxtCommunicationProtocol Class
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Abstract class representing the NXT communication protocol.

Syntax
C# Visual Basic Managed C++
public abstract class NxtCommunicationProtocol
Public MustInherit Class NxtCommunicationProtocol
public ref class NxtCommunicationProtocol abstract
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | NxtCommunicationProtocolNew() | Constructor.
 | BluetoothFactoryReset() | BLUETOOTH FACTORY RESET COMMAND
 | Boot() | BOOT COMMAND
 | Close(Byte) | CLOSE COMMAND
 | CloseModuleHandle(Byte) | CLOSE MODULE HANDLE COMMAND
 | Connect() | Connect to the NXT brick.
 | Delete(String) | DELETE COMMAND
 | DeleteUserFlash() | DELETE USER FLASH
 | Disconnect() | Disconnect from the NXT brick.
 | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | FindFirst(String) | FIND FIRST
 | FindNext(Byte) | FIND NEXT
 | GetBatteryLevel() | GETBATTERYLEVEL
 | GetCurrentProgramName() | GETCURRENTPROGRAMNAME
 | GetDeviceInfo() | GET DEVICE INFO
 | GetFirmwareVersion() | GET FIRMWARE VERSION
 | GetHashCode() | Serves as a hash function for a particular type. GetHashCode() is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object.)
 | GetInputValues(NxtSensorPort) | GETINPUTVALUES
 | GetOutputState(NxtMotorPort) | GETOUTPUTSTATE
 | GetType() | Gets the Type of the current instance. (Inherited from Object.)
 | IsConnected | Returns a boolean indicating if the NXT brick is connected.
 | KeepAlive() | KEEPALIVE
 | LsGetStatus(NxtSensorPort) | LSGETSTATUS
 | LsRead(NxtSensorPort) | LSREAD
 | LsWrite(NxtSensorPort, Byte, Byte[]()) | LSWRITE
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | MessageRead(NxtMailbox2, NxtMailbox, Boolean) | MESSAGEREAD
 | MessageWrite(NxtMailbox, String) | MESSAGEWRITE
 | OpenAppendData(String) | OPEN APPEND DATA COMMAND
 | OpenRead(String) | OPEN READ COMMAND
 | OpenReadLinear(String) | OPEN READ LINEAR COMMAND (INTERNAL COMMAND)
 | OpenWrite(String, UInt32) | OPEN WRITE COMMAND
 | OpenWriteData(String, UInt32) | OPEN WRITE DATA COMMAND
 | OpenWriteLinear(String, UInt32) | OPEN WRITE LINEAR COMMAND
 | PlaySoundfile(Boolean, String) | PLAYSOUNDFILE
 | PlayTone(UInt16, UInt16) | PLAYTONE
 | PollCommand(Byte, Byte) | POLL COMMAND
 | PollCommandLength(Byte) | POLL COMMAND LENGTH
 | Read(Byte, UInt16) | READ COMMAND
 | ReadIoMap(UInt32, UInt16, UInt16) | READ IO MAP COMMAND
 | ReplyRequired | Flag indicating if a reply should always be recieved.
 | RequestFirstModule(String) | REQUEST FIRST MODULE
 | RequestNextModule(Byte) | REQUEST NEXT MODULE
 | ResetInputScaledValue(NxtSensorPort) | RESETINPUTSCALEDVALUE
 | ResetMotorPosition(NxtMotorPort, Boolean) | RESETMOTORPOSITION
 | SetBrickName(String) | SET BRICK NAME COMMAND
 | SetInputMode(NxtSensorPort, NxtSensorType, NxtSensorMode) | SETINPUTMODE
 | SetOutputState(NxtMotorPort, SByte, NxtMotorMode, NxtMotorRegulationMode, SByte, NxtMotorRunState, UInt32) | SETOUTPUTSTATE
 | StartProgram(String) | STARTPROGRAM
 | StopProgram() | STOPPROGRAM
 | StopSoundPlayback() | STOPSOUNDPLAYBACK
 | ToString() | Returns a String that represents the current Object. (Inherited from Object.)
 | Write(Byte, Byte[]()) | WRITE COMMAND
 | WriteIoMap(UInt32, UInt16, Byte[]()) | WRITE IO MAP COMMAND
Remarks

The communication protocol for the NXT brick is specified in the documents:

Lego Mindstorms NXT,
Bluetooth Developer Kit,
Appendix 1: LEGO MINDSTORMS NXT Communication protocol
- and:
Appendix 2: LEGO MINDSTORMS NXT Direct commands

- which can be downloaded at:
http://mindstorms.lego.com/overview/NXTreme.aspx

A special thanks goes to Bram Fokke for his NXT# project:
http://nxtsharp.fokke.net/

Without his work, I doubt very much if my own work would have gotten off the ground. I have even st... ehem... borrowed a bit of his code here and there. However the major part of the code is my own.

Inheritance Hierarchy
Object
 | NxtCommunicationProtocol
 |  | NxtBluetoothConnection


NxtCommunicationProtocol Constructor

NxtCommunicationProtocol Constructor
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > NxtCommunicationProtocolNew()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Constructor.

Syntax
C# Visual Basic Managed C++
public NxtCommunicationProtocol ()
Public Sub New
public:
NxtCommunicationProtocol ()


BluetoothFactoryReset Method

BluetoothFactoryReset Method
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > BluetoothFactoryReset()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

BLUETOOTH FACTORY RESET COMMAND

Syntax
C# Visual Basic Managed C++
public void BluetoothFactoryReset ()
Public Sub BluetoothFactoryReset
public:
void BluetoothFactoryReset ()
Remarks

Reference: BDK, Appendix 1, p. 15.

This command cannot be transmitted via Bluetooth because all Bluetooth functionality is reset by this command!


Boot Method

Boot Method
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > Boot()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

BOOT COMMAND

Syntax
C# Visual Basic Managed C++
public void Boot ()
Public Sub Boot
public:
void Boot ()
Remarks

Reference: BDK, Appendix 1, p. 13.

This command can only be accepted by USB.


Close Method (handle)

Close Method (handle)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > Close(Byte)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

CLOSE COMMAND

Syntax
C# Visual Basic Managed C++
public void Close (
    byte handle
)
Public Sub Close ( _
    handle As Byte _
)
public:
void Close (
    unsigned char handle
)
Parameters
handle (Byte)
File handle to close
Remarks

Reference: BDK, Appendix 1, p. 8.


CloseModuleHandle Method (handle)

CloseModuleHandle Method (handle)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > CloseModuleHandle(Byte)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

CLOSE MODULE HANDLE COMMAND

Syntax
C# Visual Basic Managed C++
public void CloseModuleHandle (
    byte handle
)
Public Sub CloseModuleHandle ( _
    handle As Byte _
)
public:
void CloseModuleHandle (
    unsigned char handle
)
Parameters
handle (Byte)
Handle number
Remarks

Reference: BDK, Appendix 1, p. 20.

See Also
RequestFirstModule(String)
RequestNextModule(Byte)


Connect Method

Connect Method
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > Connect()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Connect to the NXT brick.

Syntax
C# Visual Basic Managed C++
public abstract void Connect ()
Public MustOverride Sub Connect
public:
virtual void Connect () abstract


Delete Method (fileName)

Delete Method (fileName)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > Delete(String)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

DELETE COMMAND

Syntax
C# Visual Basic Managed C++
public void Delete (
    string fileName
)
Public Sub Delete ( _
    fileName As String _
)
public:
void Delete (
    String^ fileName
)
Parameters
fileName (String)
The file name
Remarks

Reference: BDK, Appendix 1, p. 9.


DeleteUserFlash Method

DeleteUserFlash Method
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > DeleteUserFlash()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

DELETE USER FLASH

Syntax
C# Visual Basic Managed C++
public void DeleteUserFlash ()
Public Sub DeleteUserFlash
public:
void DeleteUserFlash ()
Remarks

Reference: BDK, Appendix 1, p. 14.


Disconnect Method

Disconnect Method
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > Disconnect()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Disconnect from the NXT brick.

Syntax
C# Visual Basic Managed C++
public abstract void Disconnect ()
Public MustOverride Sub Disconnect
public:
virtual void Disconnect () abstract


FindFirst Method (fileName)

FindFirst Method (fileName)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > FindFirst(String)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

FIND FIRST

Syntax
C# Visual Basic Managed C++
public NxtFindFileReply FindFirst (
    string fileName
)
Public Function FindFirst ( _
    fileName As String _
) As NxtFindFileReply
public:
NxtFindFileReply FindFirst (
    String^ fileName
)
Parameters
fileName (String)
Filename or -mask to search
Return Value
A NxtFindFileReply containing the result for the search
Remarks

Reference: BDK, Appendix 1, p. 9.

Close the handle after use. The handle is automatically closed if an error occurs.

See Also
FindNext(Byte)


FindNext Method (handle)

FindNext Method (handle)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > FindNext(Byte)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

FIND NEXT

Syntax
C# Visual Basic Managed C++
public NxtFindFileReply FindNext (
    byte handle
)
Public Function FindNext ( _
    handle As Byte _
) As NxtFindFileReply
public:
NxtFindFileReply FindNext (
    unsigned char handle
)
Parameters
handle (Byte)
Handle from the previous found file or from the FindFirst command
Return Value
A NxtFindFileReply containing the result for the search
Remarks

Reference: BDK, Appendix 1, p. 10.

Close the handle after use. The handle is automatically closed if an error occurs.

See Also
FindFirst(String)


GetBatteryLevel Method

GetBatteryLevel Method
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > GetBatteryLevel()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

GETBATTERYLEVEL

Syntax
C# Visual Basic Managed C++
public ushort GetBatteryLevel ()
Public Function GetBatteryLevel As UShort
public:
unsigned short GetBatteryLevel ()
Return Value
Voltage in millivolts
Remarks

Reference: BDK, Appendix 2, p. 9.


GetCurrentProgramName Method

GetCurrentProgramName Method
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > GetCurrentProgramName()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

GETCURRENTPROGRAMNAME

Syntax
C# Visual Basic Managed C++
public string GetCurrentProgramName ()
Public Function GetCurrentProgramName As String
public:
String^ GetCurrentProgramName ()
Return Value
File name of the running program
Remarks

Reference: BDK, Appendix 2, p. 11.


GetDeviceInfo Method

GetDeviceInfo Method
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > GetDeviceInfo()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

GET DEVICE INFO

Syntax
C# Visual Basic Managed C++
public NxtGetDeviceInfoReply GetDeviceInfo ()
Public Function GetDeviceInfo As NxtGetDeviceInfoReply
public:
NxtGetDeviceInfoReply GetDeviceInfo ()
Return Value
A NxtGetDeviceInfoReply containing the parsed result
Remarks

Reference: BDK, Appendix 1, p. 14.


GetFirmwareVersion Method

GetFirmwareVersion Method
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > GetFirmwareVersion()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

GET FIRMWARE VERSION

Syntax
C# Visual Basic Managed C++
public NxtGetFirmwareVersionReply GetFirmwareVersion ()
Public Function GetFirmwareVersion As NxtGetFirmwareVersionReply
public:
NxtGetFirmwareVersionReply GetFirmwareVersion ()
Return Value
A NxtGetFirmwareVersionReply with the protocol-, and the firmware versions.
Remarks

Reference: BDK, Appendix 1, p. 11.


GetInputValues Method (sensorPort)

GetInputValues Method (sensorPort)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > GetInputValues(NxtSensorPort)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

GETINPUTVALUES

Syntax
C# Visual Basic Managed C++
public NxtGetInputValuesReply GetInputValues (
    NxtSensorPort sensorPort
)
Public Function GetInputValues ( _
    sensorPort As NxtSensorPort _
) As NxtGetInputValuesReply
public:
NxtGetInputValuesReply GetInputValues (
    NxtSensorPort sensorPort
)
Parameters
sensorPort (NxtSensorPort)
Input Port
Return Value
Returns a NxtGetInputValues with the parsed reply
Remarks

Reference: BDK, Appendix 2, p. 8.

Used with passive sensors like the Touch, Light and Sound sensors.


GetOutputState Method (motorPort)

GetOutputState Method (motorPort)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > GetOutputState(NxtMotorPort)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

GETOUTPUTSTATE

Syntax
C# Visual Basic Managed C++
public NxtGetOutputStateReply GetOutputState (
    NxtMotorPort motorPort
)
Public Function GetOutputState ( _
    motorPort As NxtMotorPort _
) As NxtGetOutputStateReply
public:
NxtGetOutputStateReply GetOutputState (
    NxtMotorPort motorPort
)
Parameters
motorPort (NxtMotorPort)
Ourput Port
Return Value
Returns a parsed NxtGetOutputStateReply with the reply
Remarks

Reference: BDK, Appendix 2, p. 8.


IsConnected Property

IsConnected Property
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > IsConnected
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Returns a boolean indicating if the NXT brick is connected.

Syntax
C# Visual Basic Managed C++
public abstract bool IsConnected { get; }
Public MustOverride ReadOnly Property IsConnected As Boolean
public:
virtual bool IsConnected {
    bool get () abstract;
}


KeepAlive Method

KeepAlive Method
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > KeepAlive()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

KEEPALIVE

Syntax
C# Visual Basic Managed C++
public uint KeepAlive ()
Public Function KeepAlive As UInteger
public:
unsigned int KeepAlive ()
Return Value
Current sleep time limit, ms
Remarks

Reference: BDK, Appendix 2, p. 10.


LsGetStatus Method (sensorPort)

LsGetStatus Method (sensorPort)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > LsGetStatus(NxtSensorPort)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

LSGETSTATUS

Syntax
C# Visual Basic Managed C++
public byte LsGetStatus (
    NxtSensorPort sensorPort
)
Public Function LsGetStatus ( _
    sensorPort As NxtSensorPort _
) As Byte
public:
unsigned char LsGetStatus (
    NxtSensorPort sensorPort
)
Parameters
sensorPort (NxtSensorPort)
Sensor port
Return Value
Bytes Ready (count of available bytes to read)
Remarks

Reference: BDK, Appendix 2, p. 10.

Returns the number of bytes ready in the LowSpeed port. Used with digital sensors like the Ultrasonic sensor.

See Also
LsRead(NxtSensorPort)
LsWrite(NxtSensorPort, Byte, Byte[]())


LsRead Method (sensorPort)

LsRead Method (sensorPort)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > LsRead(NxtSensorPort)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

LSREAD

Syntax
C# Visual Basic Managed C++
public byte[] LsRead (
    NxtSensorPort sensorPort
)
Public Function LsRead ( _
    sensorPort As NxtSensorPort _
) As Byte()
public:
array<unsigned char>^ LsRead (
    NxtSensorPort sensorPort
)
Parameters
sensorPort (NxtSensorPort)
The sensor port
Return Value
The data read from the port
Remarks

Reference: BDK, Appendix 2, p. 10.

Reads data from the LowSpeed port. Used with digital sensors like the Ultrasonic sensor.

See Also
LsGetStatus(NxtSensorPort)
LsWrite(NxtSensorPort, Byte, Byte[]())


LsWrite Method (sensorPort, rxDataLength, txData)

LsWrite Method (sensorPort, rxDataLength, txData)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > LsWrite(NxtSensorPort, Byte, Byte[]())
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

LSWRITE

Syntax
C# Visual Basic Managed C++
public void LsWrite (
    NxtSensorPort sensorPort,
    byte rxDataLength,
    byte[] txData
)
Public Sub LsWrite ( _
    sensorPort As NxtSensorPort, _
    rxDataLength As Byte, _
    txData As Byte() _
)
public:
void LsWrite (
    NxtSensorPort sensorPort,
    unsigned char rxDataLength,
    array<unsigned char>^ txData
)
Parameters
sensorPort (NxtSensorPort)
Sensor port
rxDataLength (Byte)
Rx Data Length
txData (Byte []())
Tx Data
Remarks

Reference: BDK, Appendix 2, p. 10.

Writes data to the LowSpeed port. Used with digital sensors like the Ultrasonic sensor.

See Also
LsRead(NxtSensorPort)
LsGetStatus(NxtSensorPort)


MessageRead Method (remoteInboxNo, localInboxNo, remove)

MessageRead Method (remoteInboxNo, localInboxNo, remove)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > MessageRead(NxtMailbox2, NxtMailbox, Boolean)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

MESSAGEREAD

Syntax
C# Visual Basic Managed C++
public string MessageRead (
    NxtMailbox2 remoteInboxNo,
    NxtMailbox localInboxNo,
    bool remove
)
Public Function MessageRead ( _
    remoteInboxNo As NxtMailbox2, _
    localInboxNo As NxtMailbox, _
    remove As Boolean _
) As String
public:
String^ MessageRead (
    NxtMailbox2 remoteInboxNo,
    NxtMailbox localInboxNo,
    bool remove
)
Parameters
remoteInboxNo (NxtMailbox2)
Remote Inbox number
localInboxNo (NxtMailbox)
Local Inbox number
remove (Boolean)
Remove? True: clears message from Remote Inbox
Return Value
Message data
Remarks

Reference: BDK, Appendix 2, p. 11.


MessageWrite Method (inBox, messageData)

MessageWrite Method (inBox, messageData)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > MessageWrite(NxtMailbox, String)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

MESSAGEWRITE

Syntax
C# Visual Basic Managed C++
public void MessageWrite (
    NxtMailbox inBox,
    string messageData
)
Public Sub MessageWrite ( _
    inBox As NxtMailbox, _
    messageData As String _
)
public:
void MessageWrite (
    NxtMailbox inBox,
    String^ messageData
)
Parameters
inBox (NxtMailbox)
Inbox number
messageData (String)
Message data
Remarks

Reference: BDK, Appendix 2, p. 9.


OpenAppendData Method (fileName)

OpenAppendData Method (fileName)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > OpenAppendData(String)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

OPEN APPEND DATA COMMAND

Syntax
C# Visual Basic Managed C++
public NxtOpenAppendDataReply OpenAppendData (
    string fileName
)
Public Function OpenAppendData ( _
    fileName As String _
) As NxtOpenAppendDataReply
public:
NxtOpenAppendDataReply OpenAppendData (
    String^ fileName
)
Parameters
fileName (String)
The file name
Return Value
A NxtOpenAppendDataReply withe the parsed reply
Remarks

Reference: BDK, Appendix 1, p. 13.


OpenRead Method (fileName)

OpenRead Method (fileName)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > OpenRead(String)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

OPEN READ COMMAND

Syntax
C# Visual Basic Managed C++
public NxtOpenReadReply OpenRead (
    string fileName
)
Public Function OpenRead ( _
    fileName As String _
) As NxtOpenReadReply
public:
NxtOpenReadReply OpenRead (
    String^ fileName
)
Parameters
fileName (String)
The name of the file
Return Value
A NxtOpenReadReply with the result of the request
Remarks

Reference: BDK, Appendix 1, p. 7.

Close the handle after use. The handle is automatically closed if an error occurs.


OpenReadLinear Method (fileName)

OpenReadLinear Method (fileName)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > OpenReadLinear(String)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

OPEN READ LINEAR COMMAND (INTERNAL COMMAND)

Syntax
C# Visual Basic Managed C++
public uint OpenReadLinear (
    string fileName
)
Public Function OpenReadLinear ( _
    fileName As String _
) As UInteger
public:
unsigned int OpenReadLinear (
    String^ fileName
)
Parameters
fileName (String)
The file name
Return Value
Pointer to linear memory segment
Remarks

Reference: BDK, Appendix 1, p. 12.


OpenWrite Method (fileName, fileSize)

OpenWrite Method (fileName, fileSize)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > OpenWrite(String, UInt32)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

OPEN WRITE COMMAND

Syntax
C# Visual Basic Managed C++
public byte OpenWrite (
    string fileName,
    uint fileSize
)
Public Function OpenWrite ( _
    fileName As String, _
    fileSize As UInteger _
) As Byte
public:
unsigned char OpenWrite (
    String^ fileName,
    unsigned int fileSize
)
Parameters
fileName (String)
The file name
fileSize (UInt32)
The file size
Return Value
A handle to the file
Remarks

Reference: BDK, Appendix 1, p. 7.

Close the handle after use. The handle is automatically closed if an error occurs.


OpenWriteData Method (fileName, fileSize)

OpenWriteData Method (fileName, fileSize)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > OpenWriteData(String, UInt32)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

OPEN WRITE DATA COMMAND

Syntax
C# Visual Basic Managed C++
public byte OpenWriteData (
    string fileName,
    uint fileSize
)
Public Function OpenWriteData ( _
    fileName As String, _
    fileSize As UInteger _
) As Byte
public:
unsigned char OpenWriteData (
    String^ fileName,
    unsigned int fileSize
)
Parameters
fileName (String)
The file name
fileSize (UInt32)
The file size
Return Value
A handle to the file
Remarks

Reference: BDK, Appendix 1, p. 12.


OpenWriteLinear Method (fileName, fileSize)

OpenWriteLinear Method (fileName, fileSize)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > OpenWriteLinear(String, UInt32)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

OPEN WRITE LINEAR COMMAND

Syntax
C# Visual Basic Managed C++
public byte OpenWriteLinear (
    string fileName,
    uint fileSize
)
Public Function OpenWriteLinear ( _
    fileName As String, _
    fileSize As UInteger _
) As Byte
public:
unsigned char OpenWriteLinear (
    String^ fileName,
    unsigned int fileSize
)
Parameters
fileName (String)
The file name
fileSize (UInt32)
The file size
Return Value
A handle to the file
Remarks

Reference: BDK, Appendix 1, p. 11.


PlaySoundfile Method (loop, fileName)

PlaySoundfile Method (loop, fileName)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > PlaySoundfile(Boolean, String)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

PLAYSOUNDFILE

Syntax
C# Visual Basic Managed C++
public void PlaySoundfile (
    bool loop,
    string fileName
)
Public Sub PlaySoundfile ( _
    loop As Boolean, _
    fileName As String _
)
public:
void PlaySoundfile (
    bool loop,
    String^ fileName
)
Parameters
loop (Boolean)
Loop sound file indefinately?
fileName (String)
File name
Remarks

Reference: BDK, Appendix 2, p. 5.


PlayTone Method (frequency, duration)

PlayTone Method (frequency, duration)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > PlayTone(UInt16, UInt16)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

PLAYTONE

Syntax
C# Visual Basic Managed C++
public void PlayTone (
    ushort frequency,
    ushort duration
)
Public Sub PlayTone ( _
    frequency As UShort, _
    duration As UShort _
)
public:
void PlayTone (
    unsigned short frequency,
    unsigned short duration
)
Parameters
frequency (UInt16)
Frequency for the tone, Hz
duration (UInt16)
Duration of the tone, ms
Remarks

Reference: BDK, Appendix 2, p. 6.


PollCommand Method (bufferNo, commandLength)

PollCommand Method (bufferNo, commandLength)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > PollCommand(Byte, Byte)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

POLL COMMAND

Syntax
C# Visual Basic Managed C++
public void PollCommand (
    byte bufferNo,
    byte commandLength
)
Public Sub PollCommand ( _
    bufferNo As Byte, _
    commandLength As Byte _
)
public:
void PollCommand (
    unsigned char bufferNo,
    unsigned char commandLength
)
Parameters
bufferNo (Byte)
Buffer Number: 0x00 = Poll Buffer, 0x01 = High Speed buffer
commandLength (Byte)
Command length
Remarks

Reference: BDK, Appendix 1, p. 15.


PollCommandLength Method (bufferNo)

PollCommandLength Method (bufferNo)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > PollCommandLength(Byte)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

POLL COMMAND LENGTH

Syntax
C# Visual Basic Managed C++
public byte PollCommandLength (
    byte bufferNo
)
Public Function PollCommandLength ( _
    bufferNo As Byte _
) As Byte
public:
unsigned char PollCommandLength (
    unsigned char bufferNo
)
Parameters
bufferNo (Byte)
Buffer Number: 0x00 = Poll Buffer, 0x01 = High Speed buffer
Return Value
Number of bytes for the command ready in the buffer
Remarks

Reference: BDK, Appendix 1, p. 15.


Read Method (handle, bytesToRead)

Read Method (handle, bytesToRead)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > Read(Byte, UInt16)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

READ COMMAND

Syntax
C# Visual Basic Managed C++
public byte[] Read (
    byte handle,
    ushort bytesToRead
)
Public Function Read ( _
    handle As Byte, _
    bytesToRead As UShort _
) As Byte()
public:
array<unsigned char>^ Read (
    unsigned char handle,
    unsigned short bytesToRead
)
Parameters
handle (Byte)
A handle to the file
bytesToRead (UInt16)
Number of data bytes to be read
Return Value
A byte array with the read data
Remarks

Reference: BDK, Appendix 1, p. 8.


ReadIoMap Method (moduleId, offset, bytesToRead)

ReadIoMap Method (moduleId, offset, bytesToRead)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > ReadIoMap(UInt32, UInt16, UInt16)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

READ IO MAP COMMAND

Syntax
C# Visual Basic Managed C++
public byte[] ReadIoMap (
    uint moduleId,
    ushort offset,
    ushort bytesToRead
)
Public Function ReadIoMap ( _
    moduleId As UInteger, _
    offset As UShort, _
    bytesToRead As UShort _
) As Byte()
public:
array<unsigned char>^ ReadIoMap (
    unsigned int moduleId,
    unsigned short offset,
    unsigned short bytesToRead
)
Parameters
moduleId (UInt32)
The module ID
offset (UInt16)
The offset to read from
bytesToRead (UInt16)
Number of bytes to be read
Return Value
IO-map content
Remarks

Reference: BDK, Appendix 1, p. 20.


ReplyRequired Field

ReplyRequired Field
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > ReplyRequired
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Flag indicating if a reply should always be recieved.

Syntax
C# Visual Basic Managed C++
public bool ReplyRequired
Public ReplyRequired As Boolean
public:
bool ReplyRequired


RequestFirstModule Method (resourceName)

RequestFirstModule Method (resourceName)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > RequestFirstModule(String)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

REQUEST FIRST MODULE

Syntax
C# Visual Basic Managed C++
public NxtRequestModuleReply RequestFirstModule (
    string resourceName
)
Public Function RequestFirstModule ( _
    resourceName As String _
) As NxtRequestModuleReply
public:
NxtRequestModuleReply RequestFirstModule (
    String^ resourceName
)
Parameters
resourceName (String)
Modulename or -mask to search
Return Value
A NxtRequestModuleReply containing the result for the search
Remarks

Reference: BDK, Appendix 1, p. 19.

See Also
RequestNextModule(Byte)
CloseModuleHandle(Byte)


RequestNextModule Method (handle)

RequestNextModule Method (handle)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > RequestNextModule(Byte)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

REQUEST NEXT MODULE

Syntax
C# Visual Basic Managed C++
public NxtRequestModuleReply RequestNextModule (
    byte handle
)
Public Function RequestNextModule ( _
    handle As Byte _
) As NxtRequestModuleReply
public:
NxtRequestModuleReply RequestNextModule (
    unsigned char handle
)
Parameters
handle (Byte)
Handle number from the previous Request Next Module command or from the very first Request First Module command
Return Value
A NxtRequestModuleReply containing the result for the search
Remarks

Reference: BDK, Appendix 1, p. 19.

See Also
RequestFirstModule(String)
CloseModuleHandle(Byte)


ResetInputScaledValue Method (sensorPort)

ResetInputScaledValue Method (sensorPort)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > ResetInputScaledValue(NxtSensorPort)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

RESETINPUTSCALEDVALUE

Syntax
C# Visual Basic Managed C++
public void ResetInputScaledValue (
    NxtSensorPort sensorPort
)
Public Sub ResetInputScaledValue ( _
    sensorPort As NxtSensorPort _
)
public:
void ResetInputScaledValue (
    NxtSensorPort sensorPort
)
Parameters
sensorPort (NxtSensorPort)
Input Port
Remarks

Reference: BDK, Appendix 2, p. 8.


ResetMotorPosition Method (motorPort, relative)

ResetMotorPosition Method (motorPort, relative)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > ResetMotorPosition(NxtMotorPort, Boolean)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

RESETMOTORPOSITION

Syntax
C# Visual Basic Managed C++
public void ResetMotorPosition (
    NxtMotorPort motorPort,
    bool relative
)
Public Sub ResetMotorPosition ( _
    motorPort As NxtMotorPort, _
    relative As Boolean _
)
public:
void ResetMotorPosition (
    NxtMotorPort motorPort,
    bool relative
)
Parameters
motorPort (NxtMotorPort)
Output port
relative (Boolean)
Relative? True: position relative to last movement, False: absolute position
Remarks

Reference: BDK, Appendix 2, p. 9.


SetBrickName Method (brickName)

SetBrickName Method (brickName)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > SetBrickName(String)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

SET BRICK NAME COMMAND

Syntax
C# Visual Basic Managed C++
public void SetBrickName (
    string brickName
)
Public Sub SetBrickName ( _
    brickName As String _
)
public:
void SetBrickName (
    String^ brickName
)
Parameters
brickName (String)
The new name of the NXT brick
Remarks

Reference: BDK, Appendix 1, p. 13.


SetInputMode Method (sensorPort, sensorType, sensorMode)

SetInputMode Method (sensorPort, sensorType, sensorMode)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > SetInputMode(NxtSensorPort, NxtSensorType, NxtSensorMode)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

SETINPUTMODE

Syntax
C# Visual Basic Managed C++
public void SetInputMode (
    NxtSensorPort sensorPort,
    NxtSensorType sensorType,
    NxtSensorMode sensorMode
)
Public Sub SetInputMode ( _
    sensorPort As NxtSensorPort, _
    sensorType As NxtSensorType, _
    sensorMode As NxtSensorMode _
)
public:
void SetInputMode (
    NxtSensorPort sensorPort,
    NxtSensorType sensorType,
    NxtSensorMode sensorMode
)
Parameters
sensorPort (NxtSensorPort)
Input Port
sensorType (NxtSensorType)
Sensor Type
sensorMode (NxtSensorMode)
Sensor Mode
Remarks

Reference: BDK, Appendix 2, p. 7.


SetOutputState Method (motorPort, power, mode, regulationMode, turnRatio, runState, tachoLimit)

SetOutputState Method (motorPort, power, mode, regulationMode, turnRatio, runState, tachoLimit)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > SetOutputState(NxtMotorPort, SByte, NxtMotorMode, NxtMotorRegulationMode, SByte, NxtMotorRunState, UInt32)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

SETOUTPUTSTATE

Syntax
C# Visual Basic Managed C++
public void SetOutputState (
    NxtMotorPort motorPort,
    sbyte power,
    NxtMotorMode mode,
    NxtMotorRegulationMode regulationMode,
    sbyte turnRatio,
    NxtMotorRunState runState,
    uint tachoLimit
)
Public Sub SetOutputState ( _
    motorPort As NxtMotorPort, _
    power As SByte, _
    mode As NxtMotorMode, _
    regulationMode As NxtMotorRegulationMode, _
    turnRatio As SByte, _
    runState As NxtMotorRunState, _
    tachoLimit As UInteger _
)
public:
void SetOutputState (
    NxtMotorPort motorPort,
    signed char power,
    NxtMotorMode mode,
    NxtMotorRegulationMode regulationMode,
    signed char turnRatio,
    NxtMotorRunState runState,
    unsigned int tachoLimit
)
Parameters
motorPort (NxtMotorPort)
Motor port
power (SByte)
Power set point
mode (NxtMotorMode)
Mode
regulationMode (NxtMotorRegulationMode)
Regulation mode
turnRatio (SByte)
Turn ratio
runState (NxtMotorRunState)
Run state
tachoLimit (UInt32)
Tacho limit, 0: run forever
Remarks

Reference: BDK, Appendix 2, p. 6.


StartProgram Method (fileName)

StartProgram Method (fileName)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > StartProgram(String)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

STARTPROGRAM

Syntax
C# Visual Basic Managed C++
public void StartProgram (
    string fileName
)
Public Sub StartProgram ( _
    fileName As String _
)
public:
void StartProgram (
    String^ fileName
)
Parameters
fileName (String)
File name
Remarks

Reference: BDK, Appendix 2, p. 5.


StopProgram Method

StopProgram Method
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > StopProgram()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

STOPPROGRAM

Syntax
C# Visual Basic Managed C++
public void StopProgram ()
Public Sub StopProgram
public:
void StopProgram ()
Remarks

Reference: BDK, Appendix 2, p. 5.


StopSoundPlayback Method

StopSoundPlayback Method
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > StopSoundPlayback()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

STOPSOUNDPLAYBACK

Syntax
C# Visual Basic Managed C++
public void StopSoundPlayback ()
Public Sub StopSoundPlayback
public:
void StopSoundPlayback ()
Remarks

Reference: BDK, Appendix 2, p. 9.


Write Method (handle, data)

Write Method (handle, data)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > Write(Byte, Byte[]())
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

WRITE COMMAND

Syntax
C# Visual Basic Managed C++
public ushort Write (
    byte handle,
    byte[] data
)
Public Function Write ( _
    handle As Byte, _
    data As Byte() _
) As UShort
public:
unsigned short Write (
    unsigned char handle,
    array<unsigned char>^ data
)
Parameters
handle (Byte)
File handle to write to
data (Byte []())
Data to write
Return Value
Number of bytes written
Remarks

Reference: BDK, Appendix 1, p. 8.


WriteIoMap Method (moduleId, offset, ioMapContent)

WriteIoMap Method (moduleId, offset, ioMapContent)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > WriteIoMap(UInt32, UInt16, Byte[]())
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

WRITE IO MAP COMMAND

Syntax
C# Visual Basic Managed C++
public ushort WriteIoMap (
    uint moduleId,
    ushort offset,
    byte[] ioMapContent
)
Public Function WriteIoMap ( _
    moduleId As UInteger, _
    offset As UShort, _
    ioMapContent As Byte() _
) As UShort
public:
unsigned short WriteIoMap (
    unsigned int moduleId,
    unsigned short offset,
    array<unsigned char>^ ioMapContent
)
Parameters
moduleId (UInt32)
The module ID
offset (UInt16)
The offset to write to
ioMapContent (Byte []())
IO-map content to be stored in IO-map[index]...IO-map[index+N]
Return Value
The number of data that have been written
Remarks

Reference: BDK, Appendix 1, p. 21.


NxtCommunicationProtocolException Class

NxtCommunicationProtocolException Class
Namespaces > NKH.MindSqualls > NxtCommunicationProtocolException
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Exception thrown when there is an error in the communication to the NXT brick.

Syntax
C# Visual Basic Managed C++
public class NxtCommunicationProtocolException : NxtException
Public Class NxtCommunicationProtocolException _
    Inherits NxtException
public ref class NxtCommunicationProtocolException : public NxtException
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | NxtCommunicationProtocolExceptionNew(NxtCommand, NxtErrorMessage, String) | Constructor.
 | Data | Gets a collection of key/value pairs that provide additional, user-defined information about the exception. (Inherited from Exception.)
 | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | GetBaseException() | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions. (Inherited from Exception.)
 | GetHashCode() | Serves as a hash function for a particular type. GetHashCode() is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object.)
 | GetObjectData(SerializationInfo, StreamingContext) | When overridden in a derived class, sets the SerializationInfo with information about the exception. (Inherited from Exception.)
 | GetType() | Gets the runtime type of the current instance. (Inherited from Exception.)
 | HelpLink | Gets or sets a link to the help file associated with this exception. (Inherited from Exception.)
 | HResult | Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception. (Inherited from Exception.)
 | InnerException | Gets the Exception instance that caused the current exception. (Inherited from Exception.)
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | Message | Gets a message that describes the current exception. (Inherited from Exception.)
 | Source | Gets or sets the name of the application or the object that causes the error. (Inherited from Exception.)
 | StackTrace | Gets a string representation of the frames on the call stack at the time the current exception was thrown. (Inherited from Exception.)
 | TargetSite | Gets the method that throws the current exception. (Inherited from Exception.)
 | ToString() | ToString() override. (Overrides Exception.ToString().)
Inheritance Hierarchy
Object
 | Exception
 |  | ApplicationException
 |  |  | NxtException
 |  |  |  | NxtCommunicationProtocolException


NxtCommunicationProtocolException Constructor (command, errorMessage, Message)

NxtCommunicationProtocolException Constructor (command, errorMessage, Message)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocolException > NxtCommunicationProtocolExceptionNew(NxtCommand, NxtErrorMessage, String)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Constructor.

Syntax
C# Visual Basic Managed C++
public NxtCommunicationProtocolException (
    NxtCommand command,
    NxtErrorMessage errorMessage,
    string Message
)
Public Sub New ( _
    command As NxtCommand, _
    errorMessage As NxtErrorMessage, _
    Message As String _
)
public:
NxtCommunicationProtocolException (
    NxtCommand command,
    NxtErrorMessage errorMessage,
    String^ Message
)
Parameters
command (NxtCommand)
The command
errorMessage (NxtErrorMessage)
The error code
Message (String)
The exception message


ToString Method

ToString Method
Namespaces > NKH.MindSqualls > NxtCommunicationProtocolException > ToString()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

ToString() override.

Syntax
C# Visual Basic Managed C++
public override string ToString ()
Public Overrides Function ToString As String
public:
virtual String^ ToString () override
Return Value
... TBD ...


NxtDigitalSensor Class

NxtDigitalSensor Class
Namespaces > NKH.MindSqualls > NxtDigitalSensor
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Abstract class representing a Digital sensor, i.e. a sensor using the I2C protocol.

Syntax
C# Visual Basic Managed C++
public abstract class NxtDigitalSensor : NxtSensor
Public MustInherit Class NxtDigitalSensor _
    Inherits NxtSensor
public ref class NxtDigitalSensor abstract : public NxtSensor
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | NxtDigitalSensorNew() | Constructor.
 | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | GetHashCode() | Serves as a hash function for a particular type. GetHashCode() is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object.)
 | GetType() | Gets the Type of the current instance. (Inherited from Object.)
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | OnPolled | This event is fired when the sensor, or motor, is polled. (Inherited from NxtPollable.)
 | Poll() | Poll the sensor/motor. (Inherited from NxtPollable.)
 | PollInterval | Indicates if the sensorm or motor, is auto-polled or not. (Inherited from NxtPollable.)
 | ReadProductId() | Returns the name of the manufacturer, e.g. "LEGO".
 | ReadSensorType() | Returns the sensor type, e.g. "Sonar".
 | ReadVersion() | Returns the version of the sensor.
 | ToString() | Returns a String that represents the current Object. (Inherited from Object.)
Remarks

The "Device Memory Arrangement" for a Digital sensor is specified at p. 10 of the document:

LEGO MINDSTORMS NXT,
Hardware Developer Kit

which can be downloaded at:
http://mindstorms.lego.com/overview/NXTreme.aspx

The Ultrasonic sensor protocol is specifed in appendix 7 of the HDK.

"Digital I/O Communication Methods" is also explained in the Executable File Specification document, p. 70-72.

.oOo.

According to the LEGO MINDSTORMS NXT Hardware Developer Kit p. 7, sensors is divided into three types: active sensors (e.g. Robotics Invention Systems sensors), passive sensors (e.g. the NXT touch, light, and sound sensors), and digital sensors (e.g. the NXT ultrasonic sensor and the HiTechnic compass sensor). The three abstract classes NxtActiveSensor, NxtPassiveSensor, and NxtDigitalSensor reflect this.

Inheritance Hierarchy
Object
 | NxtPollable
 |  | NxtSensor
 |  |  | NxtDigitalSensor
 |  |  |  | NxtUltrasonicSensor
 |  |  |  | HiTechnicColorSensor
 |  |  |  | HiTechnicCompassSensor
See Also
NxtActiveSensor
NxtPassiveSensor


NxtDigitalSensor Constructor

NxtDigitalSensor Constructor
Namespaces > NKH.MindSqualls > NxtDigitalSensor > NxtDigitalSensorNew()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Constructor.

Syntax
C# Visual Basic Managed C++
public NxtDigitalSensor ()
Public Sub New
public:
NxtDigitalSensor ()


ReadProductId Method

ReadProductId Method
Namespaces > NKH.MindSqualls > NxtDigitalSensor > ReadProductId()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Returns the name of the manufacturer, e.g. "LEGO".

Syntax
C# Visual Basic Managed C++
public string ReadProductId ()
Public Function ReadProductId As String
public:
String^ ReadProductId ()
Return Value
... TBD ...


ReadSensorType Method

ReadSensorType Method
Namespaces > NKH.MindSqualls > NxtDigitalSensor > ReadSensorType()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Returns the sensor type, e.g. "Sonar".

Syntax
C# Visual Basic Managed C++
public string ReadSensorType ()
Public Function ReadSensorType As String
public:
String^ ReadSensorType ()
Return Value
... TBD ...


ReadVersion Method

ReadVersion Method
Namespaces > NKH.MindSqualls > NxtDigitalSensor > ReadVersion()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Returns the version of the sensor.

Syntax
C# Visual Basic Managed C++
public string ReadVersion ()
Public Function ReadVersion As String
public:
String^ ReadVersion ()
Return Value
... TBD ...


NxtErrorMessage Enumeration

NxtErrorMessage Enumeration
Namespaces > NKH.MindSqualls > NxtErrorMessage
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

ERROR MESSAGE BACK TO THE HOST

Syntax
C# Visual Basic Managed C++
public enum NxtErrorMessage
Public Enumeration NxtErrorMessage
public enum class NxtErrorMessage
Members
Member | Description
Succes | BDK, Appendix 2, p. 12.
PendingCommunicationTransactionInProgress | BDK, Appendix 2, p. 12.
SpecifiedMailboxQueueIsEmpty | BDK, Appendix 2, p. 12.
NoMoreHandles | BDK, Appendix 1, p. 16.
NoSpace | BDK, Appendix 1, p. 16.
NoMoreFiles | BDK, Appendix 1, p. 16.
EndOfFileExpected | BDK, Appendix 1, p. 16.
EndOfFile | BDK, Appendix 1, p. 16.
NotALinearFile | BDK, Appendix 1, p. 16.
FileNotFound | BDK, Appendix 1, p. 16.
HandleAllReadyClosed | BDK, Appendix 1, p. 16.
NoLinearSpace | BDK, Appendix 1, p. 16.
UndefinedError | BDK, Appendix 1, p. 16.
FileIsBusy | BDK, Appendix 1, p. 16.
NoWriteBuffers | BDK, Appendix 1, p. 16.
AppendNotPossible | BDK, Appendix 1, p. 16.
FileIsFull | BDK, Appendix 1, p. 16.
FileExists | BDK, Appendix 1, p. 16.
ModuleNotFound | BDK, Appendix 1, p. 16.
OutIfBoundary | BDK, Appendix 1, p. 16.
IllegalFileName | BDK, Appendix 1, p. 16.
IllegalHandle | BDK, Appendix 1, p. 16.
RequestFailed | BDK, Appendix 2, p. 12.
UnknownCommandOpcode | BDK, Appendix 2, p. 12.
InsanePacket | BDK, Appendix 2, p. 12.
DataContainsOutOfRangeValues | BDK, Appendix 2, p. 12.
CommunicationBusError | BDK, Appendix 2, p. 12.
NoFreeMemoryInCommunicationBuffer | BDK, Appendix 2, p. 12.
SpecifiedChannelOrConnectionIsNotValid | BDK, Appendix 2, p. 12.
SpecifiedChannelOrConnectionNotConfiguredOrBusy | BDK, Appendix 2, p. 12.
NoActiveProgram | BDK, Appendix 2, p. 12.
IllegalSizeSpecified | BDK, Appendix 2, p. 12.
IllegalMailboxQueueIdSpecified | BDK, Appendix 2, p. 12.
AttemptedToAccessInvalidFieldOfAStructure | BDK, Appendix 2, p. 12.
BadInputOrOutputSpecified | BDK, Appendix 2, p. 12.
InsufficientMemoryAvailable | BDK, Appendix 2, p. 12.
BadArguments | BDK, Appendix 2, p. 12.
Remarks

Reference: BDK, Appendix 1, p. 16.
Reference: BDK, Appendix 2, p. 12.


NxtException Class

NxtException Class
Namespaces > NKH.MindSqualls > NxtException
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Generic NXT exception.

Syntax
C# Visual Basic Managed C++
public class NxtException : ApplicationException
Public Class NxtException _
    Inherits ApplicationException
public ref class NxtException : public ApplicationException
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | NxtExceptionNew(String) | Constructor.
 | Data | Gets a collection of key/value pairs that provide additional, user-defined information about the exception. (Inherited from Exception.)
 | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | GetBaseException() | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions. (Inherited from Exception.)
 | GetHashCode() | Serves as a hash function for a particular type. GetHashCode() is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object.)
 | GetObjectData(SerializationInfo, StreamingContext) | When overridden in a derived class, sets the SerializationInfo with information about the exception. (Inherited from Exception.)
 | GetType() | Gets the runtime type of the current instance. (Inherited from Exception.)
 | HelpLink | Gets or sets a link to the help file associated with this exception. (Inherited from Exception.)
 | HResult | Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception. (Inherited from Exception.)
 | InnerException | Gets the Exception instance that caused the current exception. (Inherited from Exception.)
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | Message | Gets a message that describes the current exception. (Inherited from Exception.)
 | Source | Gets or sets the name of the application or the object that causes the error. (Inherited from Exception.)
 | StackTrace | Gets a string representation of the frames on the call stack at the time the current exception was thrown. (Inherited from Exception.)
 | TargetSite | Gets the method that throws the current exception. (Inherited from Exception.)
 | ToString() | Creates and returns a string representation of the current exception. (Inherited from Exception.)
Inheritance Hierarchy
Object
 | Exception
 |  | ApplicationException
 |  |  | NxtException
 |  |  |  | NxtCommunicationProtocolException


NxtException Constructor (Message)

NxtException Constructor (Message)
Namespaces > NKH.MindSqualls > NxtException > NxtExceptionNew(String)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Constructor.

Syntax
C# Visual Basic Managed C++
public NxtException (
    string Message
)
Public Sub New ( _
    Message As String _
)
public:
NxtException (
    String^ Message
)
Parameters
Message (String)
The exception message.


NxtFindFileReply Structure

NxtFindFileReply Structure
Namespaces > NKH.MindSqualls > NxtFindFileReply
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reply type for the FindFirst() and FindNext() functions.

Syntax
C# Visual Basic Managed C++
public struct NxtFindFileReply
Public Structure NxtFindFileReply
public value class NxtFindFileReply
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | Equals(Object) | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
 | FileFound | Boolean indicating if a file was found or not.
 | fileName | The file name.
 | fileSize | The filesize.
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | GetHashCode() | Returns the hash code for this instance. (Inherited from ValueType.)
 | GetType() | Gets the Type of the current instance. (Inherited from Object.)
 | handle | The file handle.
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | ToString() | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
See Also
FindFirst()
FindNext()


FileFound Field

FileFound Field
Namespaces > NKH.MindSqualls > NxtFindFileReply > FileFound
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Boolean indicating if a file was found or not.

Syntax
C# Visual Basic Managed C++
public bool FileFound
Public FileFound As Boolean
public:
bool FileFound


fileName Field

fileName Field
Namespaces > NKH.MindSqualls > NxtFindFileReply > fileName
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The file name.

Syntax
C# Visual Basic Managed C++
public string fileName
Public fileName As String
public:
String^ fileName


fileSize Field

fileSize Field
Namespaces > NKH.MindSqualls > NxtFindFileReply > fileSize
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The filesize.

Syntax
C# Visual Basic Managed C++
public uint fileSize
Public fileSize As UInteger
public:
unsigned int fileSize


handle Field

handle Field
Namespaces > NKH.MindSqualls > NxtFindFileReply > handle
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The file handle.

Syntax
C# Visual Basic Managed C++
public byte handle
Public handle As Byte
public:
unsigned char handle


NxtGetDeviceInfoReply Structure

NxtGetDeviceInfoReply Structure
Namespaces > NKH.MindSqualls > NxtGetDeviceInfoReply
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reply type for the GetDeviceInfo() function.

Syntax
C# Visual Basic Managed C++
public struct NxtGetDeviceInfoReply
Public Structure NxtGetDeviceInfoReply
public value class NxtGetDeviceInfoReply
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | bluetoothSignalStrength | The bluetooth signal strength.
 | btAdress | The bluetooth address.
 | Equals(Object) | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | freeUserFlash | The size of the free user flash.
 | GetHashCode() | Returns the hash code for this instance. (Inherited from ValueType.)
 | GetType() | Gets the Type of the current instance. (Inherited from Object.)
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | nxtName | The name of the NXT brick.
 | ToString() | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
See Also
GetDeviceInfo()


bluetoothSignalStrength Field

bluetoothSignalStrength Field
Namespaces > NKH.MindSqualls > NxtGetDeviceInfoReply > bluetoothSignalStrength
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The bluetooth signal strength.

Syntax
C# Visual Basic Managed C++
public uint bluetoothSignalStrength
Public bluetoothSignalStrength As UInteger
public:
unsigned int bluetoothSignalStrength


btAdress Field

btAdress Field
Namespaces > NKH.MindSqualls > NxtGetDeviceInfoReply > btAdress
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The bluetooth address.

Syntax
C# Visual Basic Managed C++
public byte[] btAdress
Public btAdress As Byte()
public:
array<unsigned char>^ btAdress


freeUserFlash Field

freeUserFlash Field
Namespaces > NKH.MindSqualls > NxtGetDeviceInfoReply > freeUserFlash
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The size of the free user flash.

Syntax
C# Visual Basic Managed C++
public uint freeUserFlash
Public freeUserFlash As UInteger
public:
unsigned int freeUserFlash


nxtName Field

nxtName Field
Namespaces > NKH.MindSqualls > NxtGetDeviceInfoReply > nxtName
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The name of the NXT brick.

Syntax
C# Visual Basic Managed C++
public string nxtName
Public nxtName As String
public:
String^ nxtName


NxtGetFirmwareVersionReply Structure

NxtGetFirmwareVersionReply Structure
Namespaces > NKH.MindSqualls > NxtGetFirmwareVersionReply
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reply type for the GetFirmwareVersion() function.

Syntax
C# Visual Basic Managed C++
public struct NxtGetFirmwareVersionReply
Public Structure NxtGetFirmwareVersionReply
public value class NxtGetFirmwareVersionReply
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | Equals(Object) | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | firmwareVersion | The firmware version.
 | GetHashCode() | Returns the hash code for this instance. (Inherited from ValueType.)
 | GetType() | Gets the Type of the current instance. (Inherited from Object.)
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | protocolVersion | The protocol version.
 | ToString() | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
See Also
GetFirmwareVersion()


firmwareVersion Field

firmwareVersion Field
Namespaces > NKH.MindSqualls > NxtGetFirmwareVersionReply > firmwareVersion
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The firmware version.

Syntax
C# Visual Basic Managed C++
public Version firmwareVersion
Public firmwareVersion As Version
public:
Version^ firmwareVersion


protocolVersion Field

protocolVersion Field
Namespaces > NKH.MindSqualls > NxtGetFirmwareVersionReply > protocolVersion
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The protocol version.

Syntax
C# Visual Basic Managed C++
public Version protocolVersion
Public protocolVersion As Version
public:
Version^ protocolVersion


NxtGetInputValuesReply Structure

NxtGetInputValuesReply Structure
Namespaces > NKH.MindSqualls > NxtGetInputValuesReply
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reply type for the GetInputValues() function.

Syntax
C# Visual Basic Managed C++
public struct NxtGetInputValuesReply
Public Structure NxtGetInputValuesReply
public value class NxtGetInputValuesReply
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | calibrated | A boolean indicating if the returned result is calibrated or not.
 | calibratedValue | The calibrated value.
 | Equals(Object) | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | GetHashCode() | Returns the hash code for this instance. (Inherited from ValueType.)
 | GetType() | Gets the Type of the current instance. (Inherited from Object.)
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | normalizedAdValue | The normalized A/D value.
 | rawAdValue | The raw A/D value.
 | scaledValue | The scaled value.
 | sensorMode | The sensor mode.
 | sensorType | The sensor type.
 | ToString() | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
 | valid | A boolean indicating if the returned result is valid or not.
See Also
GetInputValues()


calibrated Field

calibrated Field
Namespaces > NKH.MindSqualls > NxtGetInputValuesReply > calibrated
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

A boolean indicating if the returned result is calibrated or not.

Syntax
C# Visual Basic Managed C++
public bool calibrated
Public calibrated As Boolean
public:
bool calibrated


calibratedValue Field

calibratedValue Field
Namespaces > NKH.MindSqualls > NxtGetInputValuesReply > calibratedValue
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The calibrated value.

Syntax
C# Visual Basic Managed C++
public short calibratedValue
Public calibratedValue As Short
public:
short calibratedValue


normalizedAdValue Field

normalizedAdValue Field
Namespaces > NKH.MindSqualls > NxtGetInputValuesReply > normalizedAdValue
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The normalized A/D value.

Syntax
C# Visual Basic Managed C++
public ushort normalizedAdValue
Public normalizedAdValue As UShort
public:
unsigned short normalizedAdValue


rawAdValue Field

rawAdValue Field
Namespaces > NKH.MindSqualls > NxtGetInputValuesReply > rawAdValue
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The raw A/D value.

Syntax
C# Visual Basic Managed C++
public ushort rawAdValue
Public rawAdValue As UShort
public:
unsigned short rawAdValue


scaledValue Field

scaledValue Field
Namespaces > NKH.MindSqualls > NxtGetInputValuesReply > scaledValue
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The scaled value.

Syntax
C# Visual Basic Managed C++
public short scaledValue
Public scaledValue As Short
public:
short scaledValue


sensorMode Field

sensorMode Field
Namespaces > NKH.MindSqualls > NxtGetInputValuesReply > sensorMode
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The sensor mode.

Syntax
C# Visual Basic Managed C++
public NxtSensorMode sensorMode
Public sensorMode As NxtSensorMode
public:
NxtSensorMode sensorMode


sensorType Field

sensorType Field
Namespaces > NKH.MindSqualls > NxtGetInputValuesReply > sensorType
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The sensor type.

Syntax
C# Visual Basic Managed C++
public NxtSensorType sensorType
Public sensorType As NxtSensorType
public:
NxtSensorType sensorType


valid Field

valid Field
Namespaces > NKH.MindSqualls > NxtGetInputValuesReply > valid
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

A boolean indicating if the returned result is valid or not.

Syntax
C# Visual Basic Managed C++
public bool valid
Public valid As Boolean
public:
bool valid


NxtGetOutputStateReply Structure

NxtGetOutputStateReply Structure
Namespaces > NKH.MindSqualls > NxtGetOutputStateReply
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reply type for the GetOutputState() function.

Syntax
C# Visual Basic Managed C++
public struct NxtGetOutputStateReply
Public Structure NxtGetOutputStateReply
public value class NxtGetOutputStateReply
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | blockTachoCount | The block tacho count.
 | Equals(Object) | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | GetHashCode() | Returns the hash code for this instance. (Inherited from ValueType.)
 | GetType() | Gets the Type of the current instance. (Inherited from Object.)
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | mode | The motor mode.
 | power | The motor power.
 | regulationMode | The regulation mode.
 | rotationCount | The rotation count.
 | runState | The run state.
 | tachoCount | The tacho count.
 | tachoLimit | The tacho limit in degrees, 0 means unlimited.
 | ToString() | ToString()-override. (Overrides ValueType.ToString().)
 | turnRatio | The turn ratio.
See Also
GetOutputState()


blockTachoCount Field

blockTachoCount Field
Namespaces > NKH.MindSqualls > NxtGetOutputStateReply > blockTachoCount
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The block tacho count.

Syntax
C# Visual Basic Managed C++
public int blockTachoCount
Public blockTachoCount As Integer
public:
int blockTachoCount


mode Field

mode Field
Namespaces > NKH.MindSqualls > NxtGetOutputStateReply > mode
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The motor mode.

Syntax
C# Visual Basic Managed C++
public NxtMotorMode mode
Public mode As NxtMotorMode
public:
NxtMotorMode mode


power Field

power Field
Namespaces > NKH.MindSqualls > NxtGetOutputStateReply > power
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The motor power.

Syntax
C# Visual Basic Managed C++
public sbyte power
Public power As SByte
public:
signed char power


regulationMode Field

regulationMode Field
Namespaces > NKH.MindSqualls > NxtGetOutputStateReply > regulationMode
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The regulation mode.

Syntax
C# Visual Basic Managed C++
public NxtMotorRegulationMode regulationMode
Public regulationMode As NxtMotorRegulationMode
public:
NxtMotorRegulationMode regulationMode


rotationCount Field

rotationCount Field
Namespaces > NKH.MindSqualls > NxtGetOutputStateReply > rotationCount
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The rotation count.

Syntax
C# Visual Basic Managed C++
public int rotationCount
Public rotationCount As Integer
public:
int rotationCount


runState Field

runState Field
Namespaces > NKH.MindSqualls > NxtGetOutputStateReply > runState
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The run state.

Syntax
C# Visual Basic Managed C++
public NxtMotorRunState runState
Public runState As NxtMotorRunState
public:
NxtMotorRunState runState


tachoCount Field

tachoCount Field
Namespaces > NKH.MindSqualls > NxtGetOutputStateReply > tachoCount
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The tacho count.

Syntax
C# Visual Basic Managed C++
public int tachoCount
Public tachoCount As Integer
public:
int tachoCount


tachoLimit Field

tachoLimit Field
Namespaces > NKH.MindSqualls > NxtGetOutputStateReply > tachoLimit
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The tacho limit in degrees, 0 means unlimited.

Syntax
C# Visual Basic Managed C++
public uint tachoLimit
Public tachoLimit As UInteger
public:
unsigned int tachoLimit


ToString Method

ToString Method
Namespaces > NKH.MindSqualls > NxtGetOutputStateReply > ToString()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

ToString()-override.

Syntax
C# Visual Basic Managed C++
public override string ToString ()
Public Overrides Function ToString As String
public:
virtual String^ ToString () override
Return Value
... TBD ...


turnRatio Field

turnRatio Field
Namespaces > NKH.MindSqualls > NxtGetOutputStateReply > turnRatio
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The turn ratio.

Syntax
C# Visual Basic Managed C++
public sbyte turnRatio
Public turnRatio As SByte
public:
signed char turnRatio


NxtLightSensor Class

NxtLightSensor Class
Namespaces > NKH.MindSqualls > NxtLightSensor
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Class representing the Light sensor.

Syntax
C# Visual Basic Managed C++
public class NxtLightSensor : NxtPassiveSensor
Public Class NxtLightSensor _
    Inherits NxtPassiveSensor
public ref class NxtLightSensor : public NxtPassiveSensor
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | NxtLightSensorNew() | Constructor.
 | CompareIntensity | Trigger intensity.
 | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | GenerateLight | Indicates if the sensor should supply its own light.
 | GetHashCode() | Serves as a hash function for a particular type. GetHashCode() is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object.)
 | GetType() | Gets the Type of the current instance. (Inherited from Object.)
 | Intensity | The intensity of the measured light.
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | OnAboveIntensity | This event is fired whenever the measured light intensity passes above the compare-intensity.
 | OnBelowIntensity | This event is fired whenever the measured light intensity passes below the compare-intensity.
 | OnPolled | This event is fired when the sensor, or motor, is polled. (Inherited from NxtPollable.)
 | Poll() | Polls the sensor, and fires the NXT-G like events if appropriate. (Overrides NxtPassiveSensor.Poll().)
 | PollInterval | Indicates if the sensorm or motor, is auto-polled or not. (Inherited from NxtPollable.)
 | ToString() | Returns a String that represents the current Object. (Inherited from Object.)
Inheritance Hierarchy
Object
 | NxtPollable
 |  | NxtSensor
 |  |  | NxtPassiveSensor
 |  |  |  | NxtLightSensor


NxtLightSensor Constructor

NxtLightSensor Constructor
Namespaces > NKH.MindSqualls > NxtLightSensor > NxtLightSensorNew()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Constructor.

Syntax
C# Visual Basic Managed C++
public NxtLightSensor ()
Public Sub New
public:
NxtLightSensor ()


CompareIntensity Property

CompareIntensity Property
Namespaces > NKH.MindSqualls > NxtLightSensor > CompareIntensity
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Trigger intensity.

Syntax
C# Visual Basic Managed C++
public byte CompareIntensity { get; set; }
Public Property CompareIntensity As Byte
public:
unsigned char CompareIntensity {
    unsigned char get ();
    void set (unsigned char value);
}
See Also
OnAboveIntensity
OnBelowIntensity
Poll()


GenerateLight Property

GenerateLight Property
Namespaces > NKH.MindSqualls > NxtLightSensor > GenerateLight
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Indicates if the sensor should supply its own light.

Syntax
C# Visual Basic Managed C++
public bool GenerateLight { get; set; }
Public Property GenerateLight As Boolean
public:
bool GenerateLight {
    bool get ();
    void set (bool value);
}


Intensity Property

Intensity Property
Namespaces > NKH.MindSqualls > NxtLightSensor > Intensity
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The intensity of the measured light.

Syntax
C# Visual Basic Managed C++
public byte Intensity { get; }
Public ReadOnly Property Intensity As Byte
public:
unsigned char Intensity {
    unsigned char get ();
}


OnAboveIntensity Event

OnAboveIntensity Event
Namespaces > NKH.MindSqualls > NxtLightSensor > OnAboveIntensity
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

This event is fired whenever the measured light intensity passes above the compare-intensity.

Syntax
C# Visual Basic Managed C++
public event NxtSensorEvent OnAboveIntensity
Public Event OnAboveIntensity As NxtSensorEvent
public:
 event NxtSensorEvent^ OnAboveIntensity {
    void add (NxtSensorEvent^ value);
    void remove (NxtSensorEvent^ value);
}
See Also
CompareIntensity
OnBelowIntensity
Poll()


OnBelowIntensity Event

OnBelowIntensity Event
Namespaces > NKH.MindSqualls > NxtLightSensor > OnBelowIntensity
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

This event is fired whenever the measured light intensity passes below the compare-intensity.

Syntax
C# Visual Basic Managed C++
public event NxtSensorEvent OnBelowIntensity
Public Event OnBelowIntensity As NxtSensorEvent
public:
 event NxtSensorEvent^ OnBelowIntensity {
    void add (NxtSensorEvent^ value);
    void remove (NxtSensorEvent^ value);
}
See Also
CompareIntensity
OnAboveIntensity
Poll()


Poll Method

Poll Method
Namespaces > NKH.MindSqualls > NxtLightSensor > Poll()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Polls the sensor, and fires the NXT-G like events if appropriate.

Syntax
C# Visual Basic Managed C++
public override void Poll ()
Public Overrides Sub Poll
public:
virtual void Poll () override
See Also
CompareIntensity
OnAboveIntensity
OnBelowIntensity


NxtMailbox Enumeration

NxtMailbox Enumeration
Namespaces > NKH.MindSqualls > NxtMailbox
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reference: BDK, Appendix 2, p. 9.

Syntax
C# Visual Basic Managed C++
public enum NxtMailbox
Public Enumeration NxtMailbox
public enum class NxtMailbox
Members
Member | Description
Box0 | ... TBD ...
Box1 | ... TBD ...
Box2 | ... TBD ...
Box3 | ... TBD ...
Box4 | ... TBD ...
Box5 | ... TBD ...
Box6 | ... TBD ...
Box7 | ... TBD ...
Box8 | ... TBD ...
Box9 | ... TBD ...


NxtMailbox2 Enumeration

NxtMailbox2 Enumeration
Namespaces > NKH.MindSqualls > NxtMailbox2
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reference: BDK, Appendix 2, p. 9.
Reference: BDK, Appendix 2, p. 11. (see MessageRead() function).

Syntax
C# Visual Basic Managed C++
public enum NxtMailbox2
Public Enumeration NxtMailbox2
public enum class NxtMailbox2
Members
Member | Description
Box0 | ... TBD ...
Box1 | ... TBD ...
Box2 | ... TBD ...
Box3 | ... TBD ...
Box4 | ... TBD ...
Box5 | ... TBD ...
Box6 | ... TBD ...
Box7 | ... TBD ...
Box8 | ... TBD ...
Box9 | ... TBD ...
Box10 | ... TBD ...
Box11 | ... TBD ...
Box12 | ... TBD ...
Box13 | ... TBD ...
Box14 | ... TBD ...
Box15 | ... TBD ...
Box16 | ... TBD ...
Box17 | ... TBD ...
Box18 | ... TBD ...
Box19 | ... TBD ...


NxtMotor Class

NxtMotor Class
Namespaces > NKH.MindSqualls > NxtMotor
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Class representing a motor.

Syntax
C# Visual Basic Managed C++
public class NxtMotor : NxtPollable
Public Class NxtMotor _
    Inherits NxtPollable
public ref class NxtMotor : public NxtPollable
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | NxtMotorNew() | Constructor.
 | Brake() | Brake the motor.
 | Coast() | Coast the motor.
 | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | GetHashCode() | Serves as a hash function for a particular type. GetHashCode() is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object.)
 | GetType() | Gets the Type of the current instance. (Inherited from Object.)
 | Idle() | Sets the motor into the idle state.
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | OnPolled | This event is fired when the sensor, or motor, is polled. (Inherited from NxtPollable.)
 | Poll() | Poll the motor. (Overrides NxtPollable.Poll().)
 | PollInterval | Indicates if the sensorm or motor, is auto-polled or not. (Inherited from NxtPollable.)
 | Run(SByte, UInt32) | Run the motor.
 | TachoCount | Returns the current tacho count of the motor (in degrees).
 | ToString() | Returns a String that represents the current Object. (Inherited from Object.)
Inheritance Hierarchy
Object
 | NxtPollable
 |  | NxtMotor
See Also
NxtMotorSync


NxtMotor Constructor

NxtMotor Constructor
Namespaces > NKH.MindSqualls > NxtMotor > NxtMotorNew()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Constructor.

Syntax
C# Visual Basic Managed C++
public NxtMotor ()
Public Sub New
public:
NxtMotor ()


Brake Method

Brake Method
Namespaces > NKH.MindSqualls > NxtMotor > Brake()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Brake the motor.

Syntax
C# Visual Basic Managed C++
public void Brake ()
Public Sub Brake
public:
void Brake ()


Coast Method

Coast Method
Namespaces > NKH.MindSqualls > NxtMotor > Coast()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Coast the motor.

Syntax
C# Visual Basic Managed C++
public void Coast ()
Public Sub Coast
public:
void Coast ()


Idle Method

Idle Method
Namespaces > NKH.MindSqualls > NxtMotor > Idle()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Sets the motor into the idle state.

Syntax
C# Visual Basic Managed C++
public void Idle ()
Public Sub Idle
public:
void Idle ()


Poll Method

Poll Method
Namespaces > NKH.MindSqualls > NxtMotor > Poll()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Poll the motor.

Syntax
C# Visual Basic Managed C++
public override void Poll ()
Public Overrides Sub Poll
public:
virtual void Poll () override


Run Method (power, tachoLimit)

Run Method (power, tachoLimit)
Namespaces > NKH.MindSqualls > NxtMotor > Run(SByte, UInt32)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Run the motor.

Syntax
C# Visual Basic Managed C++
public void Run (
    sbyte power,
    uint tachoLimit
)
Public Sub Run ( _
    power As SByte, _
    tachoLimit As UInteger _
)
public:
void Run (
    signed char power,
    unsigned int tachoLimit
)
Parameters
power (SByte)
The power for the motor
tachoLimit (UInt32)
The duration in degrees, 0 = unlimited


TachoCount Property

TachoCount Property
Namespaces > NKH.MindSqualls > NxtMotor > TachoCount
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Returns the current tacho count of the motor (in degrees).

Syntax
C# Visual Basic Managed C++
public int TachoCount { get; }
Public ReadOnly Property TachoCount As Integer
public:
int TachoCount {
    int get ();
}


NxtMotorEvent Delegate

NxtMotorEvent Delegate
Namespaces > NKH.MindSqualls > NxtMotorEvent
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Delegate used for the NXT-G like events implemented in the motor.

Syntax
C# Visual Basic Managed C++
public delegate void NxtMotorEvent (
    NxtMotor motor
)
Public Delegate Sub NxtMotorEvent ( _
    motor As NxtMotor _
)
public delegate void NxtMotorEvent (
    NxtMotor^ motor
)
Parameters
motor (NxtMotor)
The motor


NxtMotorMode Enumeration

NxtMotorMode Enumeration
Namespaces > NKH.MindSqualls > NxtMotorMode
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reference: BDK, Appendix 2, p. 6.

Syntax
C# Visual Basic Managed C++
[FlagsAttribute]
public enum NxtMotorMode
<FlagsAttribute> _
Public Enumeration NxtMotorMode
[FlagsAttribute]
public enum class NxtMotorMode
Members
Member | Description
MOTORON | Turn on the specified motor.
BRAKE | Use run/break instead of run/float in PWM.
REGULATED | Turns on the regulation.


NxtMotorPort Enumeration

NxtMotorPort Enumeration
Namespaces > NKH.MindSqualls > NxtMotorPort
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reference: BDK, Appendix 2, p. 6.

Syntax
C# Visual Basic Managed C++
public enum NxtMotorPort
Public Enumeration NxtMotorPort
public enum class NxtMotorPort
Members
Member | Description
PortA | Motor port A.
PortB | Motor port B.
PortC | Motor port C.
All | All motor ports.


NxtMotorRegulationMode Enumeration

NxtMotorRegulationMode Enumeration
Namespaces > NKH.MindSqualls > NxtMotorRegulationMode
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reference: BDK, Appendix 2, p. 6.

Syntax
C# Visual Basic Managed C++
public enum NxtMotorRegulationMode
Public Enumeration NxtMotorRegulationMode
public enum class NxtMotorRegulationMode
Members
Member | Description
REGULATION_MODE_IDLE | No regulation will be enabled.
REGULATION_MODE_MOTOR_SPEED | Power control will be enabled on specified output.
REGULATION_MODE_MOTOR_SYNC | Syncronization will be enabled (Needs enabled on two output).


NxtMotorRunState Enumeration

NxtMotorRunState Enumeration
Namespaces > NKH.MindSqualls > NxtMotorRunState
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reference: BDK, Appendix 2, p. 6.

Syntax
C# Visual Basic Managed C++
[FlagsAttribute]
public enum NxtMotorRunState
<FlagsAttribute> _
Public Enumeration NxtMotorRunState
[FlagsAttribute]
public enum class NxtMotorRunState
Members
Member | Description
MOTOR_RUN_STATE_IDLE | Output will be idle.
MOTOR_RUN_STATE_RAMPUP | Output will ramp-up.
MOTOR_RUN_STATE_RUNNING | Output will be running.
MOTOR_RUN_STATE_RAMPDOWN | Output will ramp-down.


NxtMotorSync Class

NxtMotorSync Class
Namespaces > NKH.MindSqualls > NxtMotorSync
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Class representing a synchronized pair of motors.

Syntax
C# Visual Basic Managed C++
public class NxtMotorSync
Public Class NxtMotorSync
public ref class NxtMotorSync
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | NxtMotorSyncNew(NxtMotor, NxtMotor) | Constructor.
 | Brake() | Brakes the motors.
 | Coast() | Coasts the motors.
 | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | GetHashCode() | Serves as a hash function for a particular type. GetHashCode() is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object.)
 | GetType() | Gets the Type of the current instance. (Inherited from Object.)
 | Idle() | Puts the motors into the idle state.
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | Run(SByte, UInt16, SByte) | Run the motors (in sync).
 | ToString() | Returns a String that represents the current Object. (Inherited from Object.)
Inheritance Hierarchy
Object
NxtMotorSync
See Also
NxtMotor


NxtMotorSync Constructor (motorX, motorY)

NxtMotorSync Constructor (motorX, motorY)
Namespaces > NKH.MindSqualls > NxtMotorSync > NxtMotorSyncNew(NxtMotor, NxtMotor)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Constructor.

Syntax
C# Visual Basic Managed C++
public NxtMotorSync (
    NxtMotor motorX,
    NxtMotor motorY
)
Public Sub New ( _
    motorX As NxtMotor, _
    motorY As NxtMotor _
)
public:
NxtMotorSync (
    NxtMotor^ motorX,
    NxtMotor^ motorY
)
Parameters
motorX (NxtMotor)
The 1. motor of the synchronized pair
motorY (NxtMotor)
The 2. motor of the synchronized pair


Brake Method

Brake Method
Namespaces > NKH.MindSqualls > NxtMotorSync > Brake()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Brakes the motors.

Syntax
C# Visual Basic Managed C++
public void Brake ()
Public Sub Brake
public:
void Brake ()


Coast Method

Coast Method
Namespaces > NKH.MindSqualls > NxtMotorSync > Coast()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Coasts the motors.

Syntax
C# Visual Basic Managed C++
public void Coast ()
Public Sub Coast
public:
void Coast ()


Idle Method

Idle Method
Namespaces > NKH.MindSqualls > NxtMotorSync > Idle()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Puts the motors into the idle state.

Syntax
C# Visual Basic Managed C++
public void Idle ()
Public Sub Idle
public:
void Idle ()


Run Method (power, tachoLimit, turnRatio)

Run Method (power, tachoLimit, turnRatio)
Namespaces > NKH.MindSqualls > NxtMotorSync > Run(SByte, UInt16, SByte)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Run the motors (in sync).

Syntax
C# Visual Basic Managed C++
public void Run (
    sbyte power,
    ushort tachoLimit,
    sbyte turnRatio
)
Public Sub Run ( _
    power As SByte, _
    tachoLimit As UShort, _
    turnRatio As SByte _
)
public:
void Run (
    signed char power,
    unsigned short tachoLimit,
    signed char turnRatio
)
Parameters
power (SByte)
The poser
tachoLimit (UInt16)
The tacho limit in degrees, 0 means unlimited
turnRatio (SByte)
The turn ratio


NxtNoSensor Class

NxtNoSensor Class
Namespaces > NKH.MindSqualls > NxtNoSensor
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Class representing a port with no sensor attached.

Syntax
C# Visual Basic Managed C++
public class NxtNoSensor : NxtSensor
Public Class NxtNoSensor _
    Inherits NxtSensor
public ref class NxtNoSensor : public NxtSensor
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | NxtNoSensorNew() | Constructor.
 | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | GetHashCode() | Serves as a hash function for a particular type. GetHashCode() is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object.)
 | GetType() | Gets the Type of the current instance. (Inherited from Object.)
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | OnPolled | This event is fired when the sensor, or motor, is polled. (Inherited from NxtPollable.)
 | Poll() | This empty Pool-method effectively cancels polling on this port. (Overrides NxtPollable.Poll().)
 | PollInterval | Indicates if the sensorm or motor, is auto-polled or not. (Inherited from NxtPollable.)
 | ToString() | Returns a String that represents the current Object. (Inherited from Object.)
Inheritance Hierarchy
Object
 | NxtPollable
 |  | NxtSensor
 |  |  | NxtNoSensor


NxtNoSensor Constructor

NxtNoSensor Constructor
Namespaces > NKH.MindSqualls > NxtNoSensor > NxtNoSensorNew()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Constructor.

Syntax
C# Visual Basic Managed C++
public NxtNoSensor ()
Public Sub New
public:
NxtNoSensor ()


Poll Method

Poll Method
Namespaces > NKH.MindSqualls > NxtNoSensor > Poll()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

This empty Pool-method effectively cancels polling on this port.

Syntax
C# Visual Basic Managed C++
public override void Poll ()
Public Overrides Sub Poll
public:
virtual void Poll () override


NxtOpenAppendDataReply Structure

NxtOpenAppendDataReply Structure
Namespaces > NKH.MindSqualls > NxtOpenAppendDataReply
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reply type for the OpenAppendData() function.

Syntax
C# Visual Basic Managed C++
public struct NxtOpenAppendDataReply
Public Structure NxtOpenAppendDataReply
public value class NxtOpenAppendDataReply
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | availableFilesize | Available file size.
 | Equals(Object) | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | GetHashCode() | Returns the hash code for this instance. (Inherited from ValueType.)
 | GetType() | Gets the Type of the current instance. (Inherited from Object.)
 | handle | File handle.
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | ToString() | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
See Also
OpenAppendData()


availableFilesize Field

availableFilesize Field
Namespaces > NKH.MindSqualls > NxtOpenAppendDataReply > availableFilesize
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Available file size.

Syntax
C# Visual Basic Managed C++
public uint availableFilesize
Public availableFilesize As UInteger
public:
unsigned int availableFilesize


handle Field

handle Field
Namespaces > NKH.MindSqualls > NxtOpenAppendDataReply > handle
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

File handle.

Syntax
C# Visual Basic Managed C++
public byte handle
Public handle As Byte
public:
unsigned char handle


NxtOpenReadReply Structure

NxtOpenReadReply Structure
Namespaces > NKH.MindSqualls > NxtOpenReadReply
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reply type for the OpenRead() function.

Syntax
C# Visual Basic Managed C++
public struct NxtOpenReadReply
Public Structure NxtOpenReadReply
public value class NxtOpenReadReply
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | Equals(Object) | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
 | fileSize | File size.
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | GetHashCode() | Returns the hash code for this instance. (Inherited from ValueType.)
 | GetType() | Gets the Type of the current instance. (Inherited from Object.)
 | handle | File handle.
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | ToString() | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
See Also
OpenRead()


fileSize Field

fileSize Field
Namespaces > NKH.MindSqualls > NxtOpenReadReply > fileSize
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

File size.

Syntax
C# Visual Basic Managed C++
public uint fileSize
Public fileSize As UInteger
public:
unsigned int fileSize


handle Field

handle Field
Namespaces > NKH.MindSqualls > NxtOpenReadReply > handle
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

File handle.

Syntax
C# Visual Basic Managed C++
public byte handle
Public handle As Byte
public:
unsigned char handle


NxtPassiveSensor Class

NxtPassiveSensor Class
Namespaces > NKH.MindSqualls > NxtPassiveSensor
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Abstract class representing a Passive Sensor.

Syntax
C# Visual Basic Managed C++
public abstract class NxtPassiveSensor : NxtSensor
Public MustInherit Class NxtPassiveSensor _
    Inherits NxtSensor
public ref class NxtPassiveSensor abstract : public NxtSensor
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | NxtPassiveSensorNew(NxtSensorType, NxtSensorMode) | Constructor.
 | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | GetHashCode() | Serves as a hash function for a particular type. GetHashCode() is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object.)
 | GetType() | Gets the Type of the current instance. (Inherited from Object.)
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | OnPolled | This event is fired when the sensor, or motor, is polled. (Inherited from NxtPollable.)
 | Poll() | Poll the sensor. (Overrides NxtPollable.Poll().)
 | PollInterval | Indicates if the sensorm or motor, is auto-polled or not. (Inherited from NxtPollable.)
 | ToString() | Returns a String that represents the current Object. (Inherited from Object.)
Remarks

According to the LEGO MINDSTORMS NXT Hardware Developer Kit p. 7, sensors is divided into three types: active sensors (e.g. Robotics Invention Systems sensors), passive sensors (e.g. the NXT touch, light, and sound sensors), and digital sensors (e.g. the NXT ultrasonic sensor and the HiTechnic compass sensor). The three abstract classes NxtActiveSensor, NxtPassiveSensor, and NxtDigitalSensor reflect this.

Inheritance Hierarchy
Object
 | NxtPollable
 |  | NxtSensor
 |  |  | NxtPassiveSensor
 |  |  |  | NxtLightSensor
 |  |  |  | NxtTouchSensor
 |  |  |  | NxtSoundSensor
See Also
NxtActiveSensor
NxtDigitalSensor


NxtPassiveSensor Constructor (sensorType, sensorMode)

NxtPassiveSensor Constructor (sensorType, sensorMode)
Namespaces > NKH.MindSqualls > NxtPassiveSensor > NxtPassiveSensorNew(NxtSensorType, NxtSensorMode)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Constructor.

Syntax
C# Visual Basic Managed C++
public NxtPassiveSensor (
    NxtSensorType sensorType,
    NxtSensorMode sensorMode
)
Public Sub New ( _
    sensorType As NxtSensorType, _
    sensorMode As NxtSensorMode _
)
public:
NxtPassiveSensor (
    NxtSensorType sensorType,
    NxtSensorMode sensorMode
)
Parameters
sensorType (NxtSensorType)
Sensor type
sensorMode (NxtSensorMode)
Sensor mode


Poll Method

Poll Method
Namespaces > NKH.MindSqualls > NxtPassiveSensor > Poll()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Poll the sensor.

Syntax
C# Visual Basic Managed C++
public override void Poll ()
Public Overrides Sub Poll
public:
virtual void Poll () override


NxtPollable Class

NxtPollable Class
Namespaces > NKH.MindSqualls > NxtPollable
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Abstract class used as superclass for the NxtMotor and NxtSensor classes.

Syntax
C# Visual Basic Managed C++
public abstract class NxtPollable
Public MustInherit Class NxtPollable
public ref class NxtPollable abstract
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | NxtPollableNew() | Initializes a new instance of the NxtPollable class.
 | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | GetHashCode() | Serves as a hash function for a particular type. GetHashCode() is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object.)
 | GetType() | Gets the Type of the current instance. (Inherited from Object.)
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | OnPolled | This event is fired when the sensor, or motor, is polled.
 | Poll() | Poll the sensor/motor.
 | PollInterval | Indicates if the sensorm or motor, is auto-polled or not.
 | ToString() | Returns a String that represents the current Object. (Inherited from Object.)
Inheritance Hierarchy
Object
 | NxtPollable
 |  | NxtSensor
 |  | NxtMotor


NxtPollable Constructor

NxtPollable Constructor
Namespaces > NKH.MindSqualls > NxtPollable > NxtPollableNew()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot
Initializes a new instance of the NxtPollable class.
Syntax
C# Visual Basic Managed C++
protected NxtPollable ()
Protected Sub New
protected:
NxtPollable ()


OnPolled Event

OnPolled Event
Namespaces > NKH.MindSqualls > NxtPollable > OnPolled
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

This event is fired when the sensor, or motor, is polled.

Syntax
C# Visual Basic Managed C++
public event Polled OnPolled
Public Event OnPolled As Polled
public:
 event Polled^ OnPolled {
    void add (Polled^ value);
    void remove (Polled^ value);
}


Poll Method

Poll Method
Namespaces > NKH.MindSqualls > NxtPollable > Poll()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Poll the sensor/motor.

Syntax
C# Visual Basic Managed C++
public virtual void Poll ()
Public Overridable Sub Poll
public:
virtual void Poll ()


PollInterval Property

PollInterval Property
Namespaces > NKH.MindSqualls > NxtPollable > PollInterval
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Indicates if the sensorm or motor, is auto-polled or not.

Syntax
C# Visual Basic Managed C++
public double PollInterval { get; set; }
Public Property PollInterval As Double
public:
double PollInterval {
    double get ();
    void set (double value);
}
Value

A positive value means that the sensor is auto-pooled, and with the indicated interval i milliseconds.

Zero, or a negative value, means that the sensor is not auto-polled.


NxtRequestModuleReply Structure

NxtRequestModuleReply Structure
Namespaces > NKH.MindSqualls > NxtRequestModuleReply
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reply type for the RequestFirstModule() and RequestNextModule() functions.

Syntax
C# Visual Basic Managed C++
public struct NxtRequestModuleReply
Public Structure NxtRequestModuleReply
public value class NxtRequestModuleReply
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | Equals(Object) | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | GetHashCode() | Returns the hash code for this instance. (Inherited from ValueType.)
 | GetType() | Gets the Type of the current instance. (Inherited from Object.)
 | handle | Module handle.
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | ModuleFound | Boolean indicating if a module was found, or not.
 | moduleId | Module ID.
 | moduleIdCC | Module ID, CC-value.
 | moduleIdFF | Module ID, FF-value.
 | moduleIdPP | Module ID, PP-value.
 | moduleIdTT | Module ID, TT-value.
 | moduleIoMapSize | Module IO-map size.
 | moduleName | Module name.
 | moduleSize | Module size.
 | ToString() | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
See Also
RequestFirstModule()
RequestNextModule()


handle Field

handle Field
Namespaces > NKH.MindSqualls > NxtRequestModuleReply > handle
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Module handle.

Syntax
C# Visual Basic Managed C++
public byte handle
Public handle As Byte
public:
unsigned char handle


ModuleFound Field

ModuleFound Field
Namespaces > NKH.MindSqualls > NxtRequestModuleReply > ModuleFound
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Boolean indicating if a module was found, or not.

Syntax
C# Visual Basic Managed C++
public bool ModuleFound
Public ModuleFound As Boolean
public:
bool ModuleFound


moduleId Field

moduleId Field
Namespaces > NKH.MindSqualls > NxtRequestModuleReply > moduleId
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Module ID.

Syntax
C# Visual Basic Managed C++
public uint moduleId
Public moduleId As UInteger
public:
unsigned int moduleId


moduleIdCC Field

moduleIdCC Field
Namespaces > NKH.MindSqualls > NxtRequestModuleReply > moduleIdCC
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Module ID, CC-value.

Syntax
C# Visual Basic Managed C++
public byte moduleIdCC
Public moduleIdCC As Byte
public:
unsigned char moduleIdCC


moduleIdFF Field

moduleIdFF Field
Namespaces > NKH.MindSqualls > NxtRequestModuleReply > moduleIdFF
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Module ID, FF-value.

Syntax
C# Visual Basic Managed C++
public byte moduleIdFF
Public moduleIdFF As Byte
public:
unsigned char moduleIdFF


moduleIdPP Field

moduleIdPP Field
Namespaces > NKH.MindSqualls > NxtRequestModuleReply > moduleIdPP
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Module ID, PP-value.

Syntax
C# Visual Basic Managed C++
public byte moduleIdPP
Public moduleIdPP As Byte
public:
unsigned char moduleIdPP


moduleIdTT Field

moduleIdTT Field
Namespaces > NKH.MindSqualls > NxtRequestModuleReply > moduleIdTT
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Module ID, TT-value.

Syntax
C# Visual Basic Managed C++
public byte moduleIdTT
Public moduleIdTT As Byte
public:
unsigned char moduleIdTT


moduleIoMapSize Field

moduleIoMapSize Field
Namespaces > NKH.MindSqualls > NxtRequestModuleReply > moduleIoMapSize
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Module IO-map size.

Syntax
C# Visual Basic Managed C++
public ushort moduleIoMapSize
Public moduleIoMapSize As UShort
public:
unsigned short moduleIoMapSize


moduleName Field

moduleName Field
Namespaces > NKH.MindSqualls > NxtRequestModuleReply > moduleName
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Module name.

Syntax
C# Visual Basic Managed C++
public string moduleName
Public moduleName As String
public:
String^ moduleName


moduleSize Field

moduleSize Field
Namespaces > NKH.MindSqualls > NxtRequestModuleReply > moduleSize
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Module size.

Syntax
C# Visual Basic Managed C++
public uint moduleSize
Public moduleSize As UInteger
public:
unsigned int moduleSize


NxtSensor Class

NxtSensor Class
Namespaces > NKH.MindSqualls > NxtSensor
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Superclass representing a generic sensor.

Syntax
C# Visual Basic Managed C++
public abstract class NxtSensor : NxtPollable
Public MustInherit Class NxtSensor _
    Inherits NxtPollable
public ref class NxtSensor abstract : public NxtPollable
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | NxtSensorNew(NxtSensorType, NxtSensorMode) | Constructor.
 | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | GetHashCode() | Serves as a hash function for a particular type. GetHashCode() is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object.)
 | GetType() | Gets the Type of the current instance. (Inherited from Object.)
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | OnPolled | This event is fired when the sensor, or motor, is polled. (Inherited from NxtPollable.)
 | Poll() | Poll the sensor/motor. (Inherited from NxtPollable.)
 | PollInterval | Indicates if the sensorm or motor, is auto-polled or not. (Inherited from NxtPollable.)
 | ToString() | Returns a String that represents the current Object. (Inherited from Object.)
Remarks

Used as base class for the specific sensor classes.

Inheritance Hierarchy
Object
 | NxtPollable
 |  | NxtSensor
 |  |  | NxtDigitalSensor
 |  |  | NxtPassiveSensor
 |  |  | NxtNoSensor
 |  |  | NxtActiveSensor


NxtSensor Constructor (sensorType, sensorMode)

NxtSensor Constructor (sensorType, sensorMode)
Namespaces > NKH.MindSqualls > NxtSensor > NxtSensorNew(NxtSensorType, NxtSensorMode)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Constructor.

Syntax
C# Visual Basic Managed C++
public NxtSensor (
    NxtSensorType sensorType,
    NxtSensorMode sensorMode
)
Public Sub New ( _
    sensorType As NxtSensorType, _
    sensorMode As NxtSensorMode _
)
public:
NxtSensor (
    NxtSensorType sensorType,
    NxtSensorMode sensorMode
)
Parameters
sensorType (NxtSensorType)
The type of the sensor
sensorMode (NxtSensorMode)
The sensors mode


NxtSensorEvent Delegate

NxtSensorEvent Delegate
Namespaces > NKH.MindSqualls > NxtSensorEvent
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Delegate used for the NXT-G like events implemented in the various sensors.

Syntax
C# Visual Basic Managed C++
public delegate void NxtSensorEvent (
    NxtSensor sensor
)
Public Delegate Sub NxtSensorEvent ( _
    sensor As NxtSensor _
)
public delegate void NxtSensorEvent (
    NxtSensor^ sensor
)
Parameters
sensor (NxtSensor)
The sensor


NxtSensorMode Enumeration

NxtSensorMode Enumeration
Namespaces > NKH.MindSqualls > NxtSensorMode
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reference: BDK, Appendix 2, p. 7.

Syntax
C# Visual Basic Managed C++
public enum NxtSensorMode
Public Enumeration NxtSensorMode
public enum class NxtSensorMode
Members
Member | Description
RAWMODE | ... TBD ...
BOOLEANMODE | ... TBD ...
TRANSITIONCNTMODE | ... TBD ...
PERIODCOUNTERMODE | ... TBD ...
PCTFULLSCALEMODE | ... TBD ...
CELSIUSMODE | ... TBD ...
FAHRENHEITMODE | ... TBD ...
ANGLESTEPMODE | ... TBD ...


NxtSensorPort Enumeration

NxtSensorPort Enumeration
Namespaces > NKH.MindSqualls > NxtSensorPort
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reference: BDK, Appendix 2, p. 7.

Syntax
C# Visual Basic Managed C++
public enum NxtSensorPort
Public Enumeration NxtSensorPort
public enum class NxtSensorPort
Members
Member | Description
Port1 | Sensor port 1.
Port2 | Sensor port 2.
Port3 | Sensor port 3.
Port4 | Sensor port 4.


NxtSensorType Enumeration

NxtSensorType Enumeration
Namespaces > NKH.MindSqualls > NxtSensorType
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reference: BDK, Appendix 2, p. 7.

Syntax
C# Visual Basic Managed C++
public enum NxtSensorType
Public Enumeration NxtSensorType
public enum class NxtSensorType
Members
Member | Description
NO_SENSOR | No sensor configured.
SWITCH | NXT or RCX touch sensor.
TEMPERATURE | RCX temperature sensor.
REFLECTION | RCX light sensor.
ANGLE | RCX rotation sensor.
LIGHT_ACTIVE | NXT light sensor with floodlight enabled.
LIGHT_INACTIVE | NXT light sensor with floodlight disabled.
SOUND_DB | NXT sound sensor; dB scaling.
SOUND_DBA | NXT sound sensor; dBA scaling.
CUSTOM | Unused in NXT programs.
LOWSPEED | I2C digital sensor.
LOWSPEED_9V | I2C digital sensor; 9V power.
NO_OF_SENSOR_TYPES | "HIGHSPEED". Unused in NXT programs.
Remarks

Explantion of the values is found on p. 46 of the Executable File Specification document.


NxtSoundSensor Class

NxtSoundSensor Class
Namespaces > NKH.MindSqualls > NxtSoundSensor
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Class representing the Sound sensor.

Syntax
C# Visual Basic Managed C++
public class NxtSoundSensor : NxtPassiveSensor
Public Class NxtSoundSensor _
    Inherits NxtPassiveSensor
public ref class NxtSoundSensor : public NxtPassiveSensor
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | NxtSoundSensorNew() | Constructor.
 | CompareSoundLevel | Trigger sound level.
 | dBA | Indicting if the sensor should return results as dB or as dBA (adjusted for the human ear).
 | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | GetHashCode() | Serves as a hash function for a particular type. GetHashCode() is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object.)
 | GetType() | Gets the Type of the current instance. (Inherited from Object.)
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | OnAboveSoundLevel | This event is fired whenever the measured sound level passes above the compare-level.
 | OnBelowSoundLevel | This event is fired whenever the measured sound level passes below the compare-level.
 | OnPolled | This event is fired when the sensor, or motor, is polled. (Inherited from NxtPollable.)
 | Poll() | Polls the sensor, and fires the NXT-G like events if appropriate. (Overrides NxtPassiveSensor.Poll().)
 | PollInterval | Indicates if the sensorm or motor, is auto-polled or not. (Inherited from NxtPollable.)
 | SoundLevel | The measured sound level
 | ToString() | Returns a String that represents the current Object. (Inherited from Object.)
Inheritance Hierarchy
Object
 | NxtPollable
 |  | NxtSensor
 |  |  | NxtPassiveSensor
 |  |  |  | NxtSoundSensor


NxtSoundSensor Constructor

NxtSoundSensor Constructor
Namespaces > NKH.MindSqualls > NxtSoundSensor > NxtSoundSensorNew()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Constructor.

Syntax
C# Visual Basic Managed C++
public NxtSoundSensor ()
Public Sub New
public:
NxtSoundSensor ()


CompareSoundLevel Property

CompareSoundLevel Property
Namespaces > NKH.MindSqualls > NxtSoundSensor > CompareSoundLevel
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Trigger sound level.

Syntax
C# Visual Basic Managed C++
public byte CompareSoundLevel { get; set; }
Public Property CompareSoundLevel As Byte
public:
unsigned char CompareSoundLevel {
    unsigned char get ();
    void set (unsigned char value);
}
See Also
OnAboveSoundLevel
OnBelowSoundLevel


dBA Property

dBA Property
Namespaces > NKH.MindSqualls > NxtSoundSensor > dBA
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Indicting if the sensor should return results as dB or as dBA (adjusted for the human ear).

Syntax
C# Visual Basic Managed C++
public bool dBA { get; set; }
Public Property dBA As Boolean
public:
bool dBA {
    bool get ();
    void set (bool value);
}


OnAboveSoundLevel Event

OnAboveSoundLevel Event
Namespaces > NKH.MindSqualls > NxtSoundSensor > OnAboveSoundLevel
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

This event is fired whenever the measured sound level passes above the compare-level.

Syntax
C# Visual Basic Managed C++
public event NxtSensorEvent OnAboveSoundLevel
Public Event OnAboveSoundLevel As NxtSensorEvent
public:
 event NxtSensorEvent^ OnAboveSoundLevel {
    void add (NxtSensorEvent^ value);
    void remove (NxtSensorEvent^ value);
}
See Also
CompareSoundLevel
OnBelowSoundLevel
Poll()


OnBelowSoundLevel Event

OnBelowSoundLevel Event
Namespaces > NKH.MindSqualls > NxtSoundSensor > OnBelowSoundLevel
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

This event is fired whenever the measured sound level passes below the compare-level.

Syntax
C# Visual Basic Managed C++
public event NxtSensorEvent OnBelowSoundLevel
Public Event OnBelowSoundLevel As NxtSensorEvent
public:
 event NxtSensorEvent^ OnBelowSoundLevel {
    void add (NxtSensorEvent^ value);
    void remove (NxtSensorEvent^ value);
}
See Also
CompareSoundLevel
OnAboveSoundLevel
Poll()


Poll Method

Poll Method
Namespaces > NKH.MindSqualls > NxtSoundSensor > Poll()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Polls the sensor, and fires the NXT-G like events if appropriate.

Syntax
C# Visual Basic Managed C++
public override void Poll ()
Public Overrides Sub Poll
public:
virtual void Poll () override
See Also
CompareSoundLevel
OnAboveSoundLevel
OnBelowSoundLevel


SoundLevel Property

SoundLevel Property
Namespaces > NKH.MindSqualls > NxtSoundSensor > SoundLevel
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The measured sound level

Syntax
C# Visual Basic Managed C++
public byte SoundLevel { get; }
Public ReadOnly Property SoundLevel As Byte
public:
unsigned char SoundLevel {
    unsigned char get ();
}
See Also
dBA


NxtTouchSensor Class

NxtTouchSensor Class
Namespaces > NKH.MindSqualls > NxtTouchSensor
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Class representing the Touch sensor.

Syntax
C# Visual Basic Managed C++
public class NxtTouchSensor : NxtPassiveSensor
Public Class NxtTouchSensor _
    Inherits NxtPassiveSensor
public ref class NxtTouchSensor : public NxtPassiveSensor
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | NxtTouchSensorNew() | Constructor.
 | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | GetHashCode() | Serves as a hash function for a particular type. GetHashCode() is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object.)
 | GetType() | Gets the Type of the current instance. (Inherited from Object.)
 | IsPressed | Indicating if the sensor-button is pressed or not.
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | OnPolled | This event is fired when the sensor, or motor, is polled. (Inherited from NxtPollable.)
 | OnPressed | This event is fired when the touch sensor is pressed.
 | OnReleased | This event is fired when the touch sensor is released.
 | Poll() | Polls the sensor, and fires the NXT-G like events if appropriate. (Overrides NxtPassiveSensor.Poll().)
 | PollInterval | Indicates if the sensorm or motor, is auto-polled or not. (Inherited from NxtPollable.)
 | ToString() | Returns a String that represents the current Object. (Inherited from Object.)
Inheritance Hierarchy
Object
 | NxtPollable
 |  | NxtSensor
 |  |  | NxtPassiveSensor
 |  |  |  | NxtTouchSensor


NxtTouchSensor Constructor

NxtTouchSensor Constructor
Namespaces > NKH.MindSqualls > NxtTouchSensor > NxtTouchSensorNew()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Constructor.

Syntax
C# Visual Basic Managed C++
public NxtTouchSensor ()
Public Sub New
public:
NxtTouchSensor ()


IsPressed Property

IsPressed Property
Namespaces > NKH.MindSqualls > NxtTouchSensor > IsPressed
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Indicating if the sensor-button is pressed or not.

Syntax
C# Visual Basic Managed C++
public bool IsPressed { get; }
Public ReadOnly Property IsPressed As Boolean
public:
bool IsPressed {
    bool get ();
}


OnPressed Event

OnPressed Event
Namespaces > NKH.MindSqualls > NxtTouchSensor > OnPressed
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

This event is fired when the touch sensor is pressed.

Syntax
C# Visual Basic Managed C++
public event NxtSensorEvent OnPressed
Public Event OnPressed As NxtSensorEvent
public:
 event NxtSensorEvent^ OnPressed {
    void add (NxtSensorEvent^ value);
    void remove (NxtSensorEvent^ value);
}
See Also
OnReleased
Poll()


OnReleased Event

OnReleased Event
Namespaces > NKH.MindSqualls > NxtTouchSensor > OnReleased
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

This event is fired when the touch sensor is released.

Syntax
C# Visual Basic Managed C++
public event NxtSensorEvent OnReleased
Public Event OnReleased As NxtSensorEvent
public:
 event NxtSensorEvent^ OnReleased {
    void add (NxtSensorEvent^ value);
    void remove (NxtSensorEvent^ value);
}
See Also
OnPressed
Poll()


Poll Method

Poll Method
Namespaces > NKH.MindSqualls > NxtTouchSensor > Poll()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Polls the sensor, and fires the NXT-G like events if appropriate.

Syntax
C# Visual Basic Managed C++
public override void Poll ()
Public Overrides Sub Poll
public:
virtual void Poll () override
See Also
OnPressed
OnReleased


NxtUltrasonicSensor Class

NxtUltrasonicSensor Class
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Class representing the Ultrasonic sensor.

Syntax
C# Visual Basic Managed C++
public class NxtUltrasonicSensor : NxtDigitalSensor
Public Class NxtUltrasonicSensor _
    Inherits NxtDigitalSensor
public ref class NxtUltrasonicSensor : public NxtDigitalSensor
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | NxtUltrasonicSensorNew() | Constructor.
 | CompareDistanceCm | Trigger distance.
 | ContinuousMeasurementCommand() | Reference: HDK, Appendix 7, p. 3.
 | DistanceCm | Returns the measured distance in cm.
 | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
 | EventCaptureCommand() | Reference: HDK, Appendix 7, p. 3.
 | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
 | GetHashCode() | Serves as a hash function for a particular type. GetHashCode() is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object.)
 | GetType() | Gets the Type of the current instance. (Inherited from Object.)
 | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.)
 | OffCommand() | Reference: HDK, Appendix 7, p. 3.
 | OnInsideDistance | This event is fired if the sensor detects an object within the compare distance.
 | OnOutsideDistance | This event is fired if the sensor does not detect an object within the compare distance.
 | OnPolled | This event is fired when the sensor, or motor, is polled. (Inherited from NxtPollable.)
 | Poll() | Polls the sensor, and fires the NXT-G like events if appropriate. (Overrides NxtPollable.Poll().)
 | PollInterval | Indicates if the sensorm or motor, is auto-polled or not. (Inherited from NxtPollable.)
 | ReadActualScaleDivisor() | Reference: HDK, Appendix 7, p. 3.
 | ReadActualScaleFactor() | Reference: HDK, Appendix 7, p. 3.
 | ReadActualZero() | Reference: HDK, Appendix 7, p. 2.
 | ReadCommandState() | Reference: HDK, Appendix 7, p. 2.
 | ReadContinuousMeasurementsInterval() | Reference: HDK, Appendix 7, p. 2.
 | ReadFactoryScaleDivisor() | Returns the factory scale divisor of the sensor.
 | ReadFactoryScaleFactor() | Returns the "factory scale factor" of the sensor.
 | ReadFactoryZero() | Returns the "factory zero" of the sensor.
 | ReadMeasurementByteX(Byte) | Reference: HDK, Appendix 7, p. 2.
 | ReadMeasurementUnits() | Returns the measurement units if the sensor, e.g. "10E-2m".
 | ReadProductId() | Returns the name of the manufacturer, e.g. "LEGO". (Inherited from NxtDigitalSensor.)
 | ReadSensorType() | Returns the sensor type, e.g. "Sonar". (Inherited from NxtDigitalSensor.)
 | ReadVersion() | Returns the version of the sensor. (Inherited from NxtDigitalSensor.)
 | RequestWarmReset() | Reference: HDK, Appendix 7, p. 3.
 | SetActualScaleDivisor(Byte) | Reference: HDK, Appendix 7, p. 3.
 | SetActualScaleFactor(Byte) | Reference: HDK, Appendix 7, p. 3.
 | SetActualZero(Byte) | Reference: HDK, Appendix 7, p. 3.
 | SetContinuousMeasurementInterval(Byte) | Reference: HDK, Appendix 7, p. 3.
 | SingleShotCommand() | Reference: HDK, Appendix 7, p. 3.
 | ToString() | Returns a String that represents the current Object. (Inherited from Object.)
Remarks

The I2C protocol for the Ultrasonic sensor is specified in the document:

Lego Mindstorms NXT,
Hardware Developer Kit,
Appendix 7: LEGO MINDSTORMS NXT Ultrasonic Sensor I2C communication protocol

which can be downloaded at:
http://mindstorms.lego.com/overview/NXTreme.aspx

A special thanks goes to Dick Swan and Templar for their invaluable explanations in:
http://forums.nxtasy.org/index.php?showtopic=141

The resulting code stated out being part of the NxtUltrasonicSensor class but has since been moved to the NxtDigitalSensor class.

Inheritance Hierarchy
Object
 | NxtPollable
 |  | NxtSensor
 |  |  | NxtDigitalSensor
 |  |  |  | NxtUltrasonicSensor


NxtUltrasonicSensor Constructor

NxtUltrasonicSensor Constructor
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > NxtUltrasonicSensorNew()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Constructor.

Syntax
C# Visual Basic Managed C++
public NxtUltrasonicSensor ()
Public Sub New
public:
NxtUltrasonicSensor ()


CompareDistanceCm Property

CompareDistanceCm Property
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > CompareDistanceCm
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Trigger distance.

Syntax
C# Visual Basic Managed C++
public byte CompareDistanceCm { get; set; }
Public Property CompareDistanceCm As Byte
public:
unsigned char CompareDistanceCm {
    unsigned char get ();
    void set (unsigned char value);
}
See Also
OnInsideDistance
OnOutsideDistance


ContinuousMeasurementCommand Method

ContinuousMeasurementCommand Method
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > ContinuousMeasurementCommand()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reference: HDK, Appendix 7, p. 3.

Syntax
C# Visual Basic Managed C++
public void ContinuousMeasurementCommand ()
Public Sub ContinuousMeasurementCommand
public:
void ContinuousMeasurementCommand ()
See Also
ReadContinuousMeasurementsInterval()
SetContinuousMeasurementInterval(Byte)
SingleShotCommand()


DistanceCm Property

DistanceCm Property
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > DistanceCm
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Returns the measured distance in cm.

Syntax
C# Visual Basic Managed C++
public byte DistanceCm { get; }
Public ReadOnly Property DistanceCm As Byte
public:
unsigned char DistanceCm {
    unsigned char get ();
}


EventCaptureCommand Method

EventCaptureCommand Method
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > EventCaptureCommand()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reference: HDK, Appendix 7, p. 3.

Syntax
C# Visual Basic Managed C++
public void EventCaptureCommand ()
Public Sub EventCaptureCommand
public:
void EventCaptureCommand ()


OffCommand Method

OffCommand Method
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > OffCommand()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reference: HDK, Appendix 7, p. 3.

Syntax
C# Visual Basic Managed C++
public void OffCommand ()
Public Sub OffCommand
public:
void OffCommand ()


OnInsideDistance Event

OnInsideDistance Event
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > OnInsideDistance
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

This event is fired if the sensor detects an object within the compare distance.

Syntax
C# Visual Basic Managed C++
public event NxtSensorEvent OnInsideDistance
Public Event OnInsideDistance As NxtSensorEvent
public:
 event NxtSensorEvent^ OnInsideDistance {
    void add (NxtSensorEvent^ value);
    void remove (NxtSensorEvent^ value);
}
See Also
CompareDistanceCm
OnOutsideDistance
Poll()


OnOutsideDistance Event

OnOutsideDistance Event
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > OnOutsideDistance
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

This event is fired if the sensor does not detect an object within the compare distance.

Syntax
C# Visual Basic Managed C++
public event NxtSensorEvent OnOutsideDistance
Public Event OnOutsideDistance As NxtSensorEvent
public:
 event NxtSensorEvent^ OnOutsideDistance {
    void add (NxtSensorEvent^ value);
    void remove (NxtSensorEvent^ value);
}
See Also
CompareDistanceCm
OnInsideDistance
Poll()


Poll Method

Poll Method
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > Poll()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Polls the sensor, and fires the NXT-G like events if appropriate.

Syntax
C# Visual Basic Managed C++
public override void Poll ()
Public Overrides Sub Poll
public:
virtual void Poll () override
See Also
CompareDistanceCm
OnInsideDistance
OnOutsideDistance


ReadActualScaleDivisor Method

ReadActualScaleDivisor Method
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > ReadActualScaleDivisor()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reference: HDK, Appendix 7, p. 3.

Syntax
C# Visual Basic Managed C++
public byte ReadActualScaleDivisor ()
Public Function ReadActualScaleDivisor As Byte
public:
unsigned char ReadActualScaleDivisor ()
Return Value
... TBD ...
See Also
SetActualScaleDivisor(Byte)


ReadActualScaleFactor Method

ReadActualScaleFactor Method
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > ReadActualScaleFactor()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reference: HDK, Appendix 7, p. 3.

Syntax
C# Visual Basic Managed C++
public byte ReadActualScaleFactor ()
Public Function ReadActualScaleFactor As Byte
public:
unsigned char ReadActualScaleFactor ()
Return Value
... TBD ...
See Also
SetActualScaleFactor(Byte)


ReadActualZero Method

ReadActualZero Method
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > ReadActualZero()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reference: HDK, Appendix 7, p. 2.

Syntax
C# Visual Basic Managed C++
public byte ReadActualZero ()
Public Function ReadActualZero As Byte
public:
unsigned char ReadActualZero ()
Return Value
... TBD ...
See Also
SetActualZero(Byte)


ReadCommandState Method

ReadCommandState Method
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > ReadCommandState()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reference: HDK, Appendix 7, p. 2.

Syntax
C# Visual Basic Managed C++
public byte ReadCommandState ()
Public Function ReadCommandState As Byte
public:
unsigned char ReadCommandState ()
Return Value
... TBD ...


ReadContinuousMeasurementsInterval Method

ReadContinuousMeasurementsInterval Method
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > ReadContinuousMeasurementsInterval()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reference: HDK, Appendix 7, p. 2.

Syntax
C# Visual Basic Managed C++
public byte ReadContinuousMeasurementsInterval ()
Public Function ReadContinuousMeasurementsInterval As Byte
public:
unsigned char ReadContinuousMeasurementsInterval ()
Return Value
... TBD ...
See Also
ContinuousMeasurementCommand()
SetContinuousMeasurementInterval(Byte)


ReadFactoryScaleDivisor Method

ReadFactoryScaleDivisor Method
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > ReadFactoryScaleDivisor()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Returns the factory scale divisor of the sensor.

Syntax
C# Visual Basic Managed C++
public byte ReadFactoryScaleDivisor ()
Public Function ReadFactoryScaleDivisor As Byte
public:
unsigned char ReadFactoryScaleDivisor ()
Return Value
... TBD ...


ReadFactoryScaleFactor Method

ReadFactoryScaleFactor Method
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > ReadFactoryScaleFactor()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Returns the "factory scale factor" of the sensor.

Syntax
C# Visual Basic Managed C++
public byte ReadFactoryScaleFactor ()
Public Function ReadFactoryScaleFactor As Byte
public:
unsigned char ReadFactoryScaleFactor ()
Return Value
... TBD ...


ReadFactoryZero Method

ReadFactoryZero Method
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > ReadFactoryZero()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Returns the "factory zero" of the sensor.

Syntax
C# Visual Basic Managed C++
public byte ReadFactoryZero ()
Public Function ReadFactoryZero As Byte
public:
unsigned char ReadFactoryZero ()
Return Value
... TBD ...


ReadMeasurementByteX Method (x)

ReadMeasurementByteX Method (x)
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > ReadMeasurementByteX(Byte)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reference: HDK, Appendix 7, p. 2.

Syntax
C# Visual Basic Managed C++
public byte ReadMeasurementByteX (
    byte x
)
Public Function ReadMeasurementByteX ( _
    x As Byte _
) As Byte
public:
unsigned char ReadMeasurementByteX (
    unsigned char x
)
Parameters
x (Byte)
The byte no.
Return Value
... TBD ...


ReadMeasurementUnits Method

ReadMeasurementUnits Method
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > ReadMeasurementUnits()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Returns the measurement units if the sensor, e.g. "10E-2m".

Syntax
C# Visual Basic Managed C++
public string ReadMeasurementUnits ()
Public Function ReadMeasurementUnits As String
public:
String^ ReadMeasurementUnits ()
Return Value
... TBD ...


RequestWarmReset Method

RequestWarmReset Method
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > RequestWarmReset()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reference: HDK, Appendix 7, p. 3.

Syntax
C# Visual Basic Managed C++
public void RequestWarmReset ()
Public Sub RequestWarmReset
public:
void RequestWarmReset ()


SetActualScaleDivisor Method (value)

SetActualScaleDivisor Method (value)
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > SetActualScaleDivisor(Byte)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reference: HDK, Appendix 7, p. 3.

Syntax
C# Visual Basic Managed C++
public void SetActualScaleDivisor (
    byte value
)
Public Sub SetActualScaleDivisor ( _
    value As Byte _
)
public:
void SetActualScaleDivisor (
    unsigned char value
)
Parameters
value (Byte)
The value
Remarks
See the remark at ReadActualScaleDivisor().
See Also
ReadActualScaleDivisor()


SetActualScaleFactor Method (value)

SetActualScaleFactor Method (value)
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > SetActualScaleFactor(Byte)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reference: HDK, Appendix 7, p. 3.

Syntax
C# Visual Basic Managed C++
public void SetActualScaleFactor (
    byte value
)
Public Sub SetActualScaleFactor ( _
    value As Byte _
)
public:
void SetActualScaleFactor (
    unsigned char value
)
Parameters
value (Byte)
The value
See Also
ReadActualScaleFactor()


SetActualZero Method (value)

SetActualZero Method (value)
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > SetActualZero(Byte)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reference: HDK, Appendix 7, p. 3.

Syntax
C# Visual Basic Managed C++
public void SetActualZero (
    byte value
)
Public Sub SetActualZero ( _
    value As Byte _
)
public:
void SetActualZero (
    unsigned char value
)
Parameters
value (Byte)
The value
See Also
ReadActualZero()


SetContinuousMeasurementInterval Method (interval)

SetContinuousMeasurementInterval Method (interval)
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > SetContinuousMeasurementInterval(Byte)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reference: HDK, Appendix 7, p. 3.

Syntax
C# Visual Basic Managed C++
public void SetContinuousMeasurementInterval (
    byte interval
)
Public Sub SetContinuousMeasurementInterval ( _
    interval As Byte _
)
public:
void SetContinuousMeasurementInterval (
    unsigned char interval
)
Parameters
interval (Byte)
The interval
See Also
ContinuousMeasurementCommand()
ReadContinuousMeasurementsInterval()


SingleShotCommand Method

SingleShotCommand Method
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > SingleShotCommand()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Reference: HDK, Appendix 7, p. 3.

Syntax
C# Visual Basic Managed C++
public void SingleShotCommand ()
Public Sub SingleShotCommand
public:
void SingleShotCommand ()
See Also
ContinuousMeasurementCommand()


Polled Delegate

Polled Delegate
Namespaces > NKH.MindSqualls > Polled
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Delegate used when a motor or sensor is polled.

Syntax
C# Visual Basic Managed C++
public delegate void Polled (
    NxtPollable polledItem
)
Public Delegate Sub Polled ( _
    polledItem As NxtPollable _
)
public delegate void Polled (
    NxtPollable^ polledItem
)
Parameters
polledItem (NxtPollable)
The motor/sensor.


Namespaces

Namespaces
Namespaces
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot
Namespaces
Namespace | Description
NKH.MindSqualls | Contains classes for communicating with a LEGO MINDSTORMS NXT robot; bluetooth connection, the brick itself, motors and sensors.