NKH.MindSqualls Namespace

MindSqualls v1.2 beta 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 | HiTechnicAccelerationSensor | Class representing the Acceleration / Tilt Sensor sensor from HiTechnic: http://www.hitechnic.com
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 | NxtConnectionException | ... TBD ...
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. Remarks This class has been modified from using System.Timers.Timer (in versions 1.0 and 1.1) to using System.Threading.Timer in order to be able to function with the compact framework (i.e. to run on a PDA). A special thanks to Giorgio T. for his suggestion.
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


HiTechnicAccelerationSensor Class

MindSqualls v1.2 beta 1 documentation
HiTechnicAccelerationSensor Class
Namespaces > NKH.MindSqualls > HiTechnicAccelerationSensor
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Class representing the Acceleration / Tilt Sensor sensor from HiTechnic: http://www.hitechnic.com

Syntax
C# Visual Basic Managed C++
public class HiTechnicAccelerationSensor : NxtDigitalSensor
Public Class HiTechnicAccelerationSensor _
    Inherits NxtDigitalSensor
public ref class HiTechnicAccelerationSensor : public NxtDigitalSensor
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | HiTechnicAccelerationSensorNew() | 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 (Inherited from NxtSensor.)
 | PollInterval | Indicates if the sensor, 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.)
 | scalíng | Change this value, to finetune the value of the acceleration sensor. The current value, = 9.82/206.3, is the best fit for my own sensor. Remarks The component used in the sensor is only guaranteed to be accurate to +/- 10%.
 | sensorPort | The port the sensor is attached to. (Inherited from NxtSensor.)
 | sensorType | The type of the sensor. (Inherited from NxtSensor.)
 | ToString() | Returns a String that represents the current Object. (Inherited from Object.)
 | XAxisAcceleration() | Acceleration coordinate of the X-axis.
 | XAxisLower2Bits() | X axis lower 2 bits
 | XAxisUpper8Bits() | X axis upper 8 bits
 | YAxisAcceleration() | Acceleration coordinate of the Y-axis.
 | YAxisLower2Bits() | Y axis lower 2 bits
 | YAxisUpper8Bits() | Y axis upper 8 bits
 | ZAxisAcceleration() | Acceleration coordinate of the Z-axis.
 | ZAxisLower2Bits() | Z axis lower 2 bits
 | ZAxisUpper8Bits() | Z axis upper 8 bits
Remarks

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

Also a special thanks to Ronny H. for providing me with a qualified implementation details on the acceleration sensor before I had purchased my own copy.

Inheritance Hierarchy
Object
 | NxtPollable
 |  | NxtSensor
 |  |  | NxtDigitalSensor
 |  |  |  | HiTechnicAccelerationSensor

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


HiTechnicAccelerationSensor Constructor

MindSqualls v1.2 beta 1 documentation
HiTechnicAccelerationSensor Constructor
Namespaces > NKH.MindSqualls > HiTechnicAccelerationSensor > HiTechnicAccelerationSensorNew()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Constructor.

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


scalíng Field

MindSqualls v1.2 beta 1 documentation
scalíng Field
Namespaces > NKH.MindSqualls > HiTechnicAccelerationSensor > scalíng
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Change this value, to finetune the value of the acceleration sensor.

The current value, = 9.82/206.3, is the best fit for my own sensor.

Remarks

The component used in the sensor is only guaranteed to be accurate to +/- 10%.

Syntax
C# Visual Basic Managed C++
public double scalíng
Public scalíng As Double
public:
double scalíng


XAxisAcceleration Method

MindSqualls v1.2 beta 1 documentation
XAxisAcceleration Method
Namespaces > NKH.MindSqualls > HiTechnicAccelerationSensor > XAxisAcceleration()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Acceleration coordinate of the X-axis.

Syntax
C# Visual Basic Managed C++
public Nullable<double> XAxisAcceleration ()
Public Function XAxisAcceleration As Nullable(Of Double)
public:
Nullable<double> XAxisAcceleration ()
Return Value
The acceleration coordinate


XAxisLower2Bits Method

MindSqualls v1.2 beta 1 documentation
XAxisLower2Bits Method
Namespaces > NKH.MindSqualls > HiTechnicAccelerationSensor > XAxisLower2Bits()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

X axis lower 2 bits

Syntax
C# Visual Basic Managed C++
public Nullable<byte> XAxisLower2Bits ()
Public Function XAxisLower2Bits As Nullable(Of Byte)
public:
Nullable<unsigned char> XAxisLower2Bits ()
Return Value
The lower 2 bits of the X-component of the acceleration vector
Remarks

Should only be used if the full precision is needed.

See Also
XAxisUpper8Bits()


XAxisUpper8Bits Method

MindSqualls v1.2 beta 1 documentation
XAxisUpper8Bits Method
Namespaces > NKH.MindSqualls > HiTechnicAccelerationSensor > XAxisUpper8Bits()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

X axis upper 8 bits

Syntax
C# Visual Basic Managed C++
public Nullable<sbyte> XAxisUpper8Bits ()
Public Function XAxisUpper8Bits As Nullable(Of SByte)
public:
Nullable<signed char> XAxisUpper8Bits ()
Return Value
The X-component of the acceleration vector
See Also
YAxisUpper8Bits()
ZAxisUpper8Bits()
XAxisLower2Bits()


YAxisAcceleration Method

MindSqualls v1.2 beta 1 documentation
YAxisAcceleration Method
Namespaces > NKH.MindSqualls > HiTechnicAccelerationSensor > YAxisAcceleration()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Acceleration coordinate of the Y-axis.

Syntax
C# Visual Basic Managed C++
public Nullable<double> YAxisAcceleration ()
Public Function YAxisAcceleration As Nullable(Of Double)
public:
Nullable<double> YAxisAcceleration ()
Return Value
The acceleration coordinate


YAxisLower2Bits Method

MindSqualls v1.2 beta 1 documentation
YAxisLower2Bits Method
Namespaces > NKH.MindSqualls > HiTechnicAccelerationSensor > YAxisLower2Bits()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Y axis lower 2 bits

Syntax
C# Visual Basic Managed C++
public Nullable<byte> YAxisLower2Bits ()
Public Function YAxisLower2Bits As Nullable(Of Byte)
public:
Nullable<unsigned char> YAxisLower2Bits ()
Return Value
The lower 2 bits of the Y-component of the acceleration vector
Remarks

Should only be used if the full precision is needed.

See Also
YAxisUpper8Bits()


YAxisUpper8Bits Method

MindSqualls v1.2 beta 1 documentation
YAxisUpper8Bits Method
Namespaces > NKH.MindSqualls > HiTechnicAccelerationSensor > YAxisUpper8Bits()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Y axis upper 8 bits

Syntax
C# Visual Basic Managed C++
public Nullable<sbyte> YAxisUpper8Bits ()
Public Function YAxisUpper8Bits As Nullable(Of SByte)
public:
Nullable<signed char> YAxisUpper8Bits ()
Return Value
The Y-component of the acceleration vector
See Also
XAxisUpper8Bits()
ZAxisUpper8Bits()
YAxisLower2Bits()


ZAxisAcceleration Method

MindSqualls v1.2 beta 1 documentation
ZAxisAcceleration Method
Namespaces > NKH.MindSqualls > HiTechnicAccelerationSensor > ZAxisAcceleration()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Acceleration coordinate of the Z-axis.

Syntax
C# Visual Basic Managed C++
public Nullable<double> ZAxisAcceleration ()
Public Function ZAxisAcceleration As Nullable(Of Double)
public:
Nullable<double> ZAxisAcceleration ()
Return Value
The acceleration coordinate


ZAxisLower2Bits Method

MindSqualls v1.2 beta 1 documentation
ZAxisLower2Bits Method
Namespaces > NKH.MindSqualls > HiTechnicAccelerationSensor > ZAxisLower2Bits()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Z axis lower 2 bits

Syntax
C# Visual Basic Managed C++
public Nullable<byte> ZAxisLower2Bits ()
Public Function ZAxisLower2Bits As Nullable(Of Byte)
public:
Nullable<unsigned char> ZAxisLower2Bits ()
Return Value
The lower 2 bits of the Z-component of the acceleration vector
Remarks

Should only be used if the full precision is needed.

See Also
ZAxisUpper8Bits()


ZAxisUpper8Bits Method

MindSqualls v1.2 beta 1 documentation
ZAxisUpper8Bits Method
Namespaces > NKH.MindSqualls > HiTechnicAccelerationSensor > ZAxisUpper8Bits()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Z axis upper 8 bits

Syntax
C# Visual Basic Managed C++
public Nullable<sbyte> ZAxisUpper8Bits ()
Public Function ZAxisUpper8Bits As Nullable(Of SByte)
public:
Nullable<signed char> ZAxisUpper8Bits ()
Return Value
The Z-component of the acceleration vector
See Also
XAxisUpper8Bits()
YAxisUpper8Bits()
ZAxisLower2Bits()


HiTechnicColorSensor Class

MindSqualls v1.2 beta 1 documentation
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 (Inherited from NxtSensor.)
 | PollInterval | Indicates if the sensor, 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.
 | sensorPort | The port the sensor is attached to. (Inherited from NxtSensor.)
 | sensorType | The type of the sensor. (Inherited from NxtSensor.)
 | 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 technical information.

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


HiTechnicColorSensor Constructor

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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 Nullable<byte> BlueReading ()
Public Function BlueReading As Nullable(Of Byte)
public:
Nullable<unsigned char> BlueReading ()
Return Value
... TBD ...


ColorIndexNumber Method

MindSqualls v1.2 beta 1 documentation
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 Nullable<byte> ColorIndexNumber ()
Public Function ColorIndexNumber As Nullable(Of Byte)
public:
Nullable<unsigned char> ColorIndexNumber ()
Return Value
... TBD ...


ColorNumber Property

MindSqualls v1.2 beta 1 documentation
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 Nullable<byte> ColorNumber { get; }
Public ReadOnly Property ColorNumber As Nullable(Of Byte)
public:
Nullable<unsigned char> ColorNumber {
    Nullable<unsigned char> get ();
}


GreenReading Method

MindSqualls v1.2 beta 1 documentation
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 Nullable<byte> GreenReading ()
Public Function GreenReading As Nullable(Of Byte)
public:
Nullable<unsigned char> GreenReading ()
Return Value
... TBD ...


NormalizedBlueReading Method

MindSqualls v1.2 beta 1 documentation
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 Nullable<byte> NormalizedBlueReading ()
Public Function NormalizedBlueReading As Nullable(Of Byte)
public:
Nullable<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

MindSqualls v1.2 beta 1 documentation
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 Nullable<byte> NormalizedGreenReading ()
Public Function NormalizedGreenReading As Nullable(Of Byte)
public:
Nullable<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

MindSqualls v1.2 beta 1 documentation
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 Nullable<byte> NormalizedRedReading ()
Public Function NormalizedRedReading As Nullable(Of Byte)
public:
Nullable<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

MindSqualls v1.2 beta 1 documentation
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 Nullable<ushort> RawBlueSensorReading ()
Public Function RawBlueSensorReading As Nullable(Of UShort)
public:
Nullable<unsigned short> RawBlueSensorReading ()
Return Value
... TBD ...


RawGreenSensorReading Method

MindSqualls v1.2 beta 1 documentation
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 Nullable<ushort> RawGreenSensorReading ()
Public Function RawGreenSensorReading As Nullable(Of UShort)
public:
Nullable<unsigned short> RawGreenSensorReading ()
Return Value
... TBD ...


RawRedSensorReading Method

MindSqualls v1.2 beta 1 documentation
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 Nullable<ushort> RawRedSensorReading ()
Public Function RawRedSensorReading As Nullable(Of UShort)
public:
Nullable<unsigned short> RawRedSensorReading ()
Return Value
... TBD ...


RedReading Method

MindSqualls v1.2 beta 1 documentation
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 Nullable<byte> RedReading ()
Public Function RedReading As Nullable(Of Byte)
public:
Nullable<unsigned char> RedReading ()
Return Value
... TBD ...


HiTechnicCompassSensor Class

MindSqualls v1.2 beta 1 documentation
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.
 | OnInsideRange | This event is fired when the Heading passes inside the Range-interval.
 | OnOutsideRange | This event is fired when the Heading passes outside the Range-interval.
 | 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 NxtSensor.Poll().)
 | pollData | The data from the previous poll of the sensor.
 | PollInterval | Indicates if the sensor, or motor, is auto-polled or not. (Inherited from NxtPollable.)
 | RangeA | Lower boundary of the Range-interval.
 | RangeB | Upper boundary of the Range-interval.
 | 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.)
 | sensorPort | The port the sensor is attached to. (Inherited from NxtSensor.)
 | sensorType | The type of the sensor. (Inherited from NxtSensor.)
 | 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 technical information.

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


HiTechnicCompassSensor Constructor

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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 Nullable<ushort> Heading { get; }
Public ReadOnly Property Heading As Nullable(Of UShort)
public:
Nullable<unsigned short> Heading {
    Nullable<unsigned short> get ();
}
Return Value


ModeControl Method

MindSqualls v1.2 beta 1 documentation
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 Nullable<byte> ModeControl ()
Public Function ModeControl As Nullable(Of Byte)
public:
Nullable<unsigned char> ModeControl ()
Return Value
The value of the mode control


OneDegreeAdder Method

MindSqualls v1.2 beta 1 documentation
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 Nullable<byte> OneDegreeAdder ()
Public Function OneDegreeAdder As Nullable(Of Byte)
public:
Nullable<unsigned char> OneDegreeAdder ()
Return Value
The adder


OnInsideRange Event

MindSqualls v1.2 beta 1 documentation
OnInsideRange Event
Namespaces > NKH.MindSqualls > HiTechnicCompassSensor > OnInsideRange
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

This event is fired when the Heading passes inside the Range-interval.

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


OnOutsideRange Event

MindSqualls v1.2 beta 1 documentation
OnOutsideRange Event
Namespaces > NKH.MindSqualls > HiTechnicCompassSensor > OnOutsideRange
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

This event is fired when the Heading passes outside the Range-interval.

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


Poll Method

MindSqualls v1.2 beta 1 documentation
Poll Method
Namespaces > NKH.MindSqualls > HiTechnicCompassSensor > 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
RangeA
RangeB
OnInsideRange
OnOutsideRange


pollData Field

MindSqualls v1.2 beta 1 documentation
pollData Field
Namespaces > NKH.MindSqualls > HiTechnicCompassSensor > pollData
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The data from the previous poll of the sensor.

Syntax
C# Visual Basic Managed C++
protected Nullable<byte> pollData
Protected pollData As Nullable(Of Byte)
protected:
Nullable<unsigned char> pollData
See Also
Poll()


RangeA Property

MindSqualls v1.2 beta 1 documentation
RangeA Property
Namespaces > NKH.MindSqualls > HiTechnicCompassSensor > RangeA
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Lower boundary of the Range-interval.

Syntax
C# Visual Basic Managed C++
public ushort RangeA { get; set; }
Public Property RangeA As UShort
public:
unsigned short RangeA {
    unsigned short get ();
    void set (unsigned short value);
}
See Also
RangeB
OnInsideRange
OnOutsideRange
Poll()


RangeB Property

MindSqualls v1.2 beta 1 documentation
RangeB Property
Namespaces > NKH.MindSqualls > HiTechnicCompassSensor > RangeB
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Upper boundary of the Range-interval.

Syntax
C# Visual Basic Managed C++
public ushort RangeB { get; set; }
Public Property RangeB As UShort
public:
unsigned short RangeB {
    unsigned short get ();
    void set (unsigned short value);
}
See Also
RangeA
OnInsideRange
OnOutsideRange
Poll()


TwoDegreeHeading Method

MindSqualls v1.2 beta 1 documentation
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 Nullable<byte> TwoDegreeHeading ()
Public Function TwoDegreeHeading As Nullable(Of Byte)
public:
Nullable<unsigned char> TwoDegreeHeading ()
Return Value
The heading


NxtActiveSensor Class

MindSqualls v1.2 beta 1 documentation
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 (Inherited from NxtSensor.)
 | PollInterval | Indicates if the sensor, or motor, is auto-polled or not. (Inherited from NxtPollable.)
 | sensorPort | The port the sensor is attached to. (Inherited from NxtSensor.)
 | sensorType | The type of the sensor. (Inherited from NxtSensor.)
 | 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)

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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(String) | Constructor.
 | 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 to the NXT brick via bluetooth. (Overrides NxtCommunicationProtocol.Connect().)
 | Delete(String) | DELETE COMMAND (Inherited from NxtCommunicationProtocol.)
 | DeleteUserFlash() | DELETE USER FLASH (Inherited from NxtCommunicationProtocol.)
 | Disconnect() | Disconnect from the brick. (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 connected to the NXT brick. (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.)
 | Send(Byte[]()) | Send a request for the NXT brick, and if applicable, receive the reply. (Overrides NxtCommunicationProtocol.Send(Byte[]()).)
 | 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

MindSqualls v1.2 beta 1 documentation
NxtBluetoothConnection Constructor
Namespaces > NKH.MindSqualls > NxtBluetoothConnection > NxtBluetoothConnectionNew
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot
Members
Icon | Member | Description
 | NxtBluetoothConnectionNew(Byte) | Constructor.
 | NxtBluetoothConnectionNew(String) | Constructor.


NxtBluetoothConnection Constructor (serialPortNo)

MindSqualls v1.2 beta 1 documentation
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


NxtBluetoothConnection Constructor (serialPortName)

MindSqualls v1.2 beta 1 documentation
NxtBluetoothConnection Constructor (serialPortName)
Namespaces > NKH.MindSqualls > NxtBluetoothConnection > NxtBluetoothConnectionNew(String)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Constructor.

Syntax
C# Visual Basic Managed C++
public NxtBluetoothConnection (
    string serialPortName
)
Public Sub New ( _
    serialPortName As String _
)
public:
NxtBluetoothConnection (
    String^ serialPortName
)
Parameters
serialPortName (String)
The COM port used by the Bluetooth link


Connect Method

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

Connect to the NXT brick via bluetooth.

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


Disconnect Method

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

Disconnect from the brick.

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


IsConnected Property

MindSqualls v1.2 beta 1 documentation
IsConnected Property
Namespaces > NKH.MindSqualls > NxtBluetoothConnection > IsConnected
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Indicates if connected to the NXT brick.

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;
}


Send Method (request)

MindSqualls v1.2 beta 1 documentation
Send Method (request)
Namespaces > NKH.MindSqualls > NxtBluetoothConnection > Send(Byte[]())
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Send a request for the NXT brick, and if applicable, receive the reply.

Syntax
C# Visual Basic Managed C++
protected override byte[] Send (
    byte[] request
)
Protected Overrides Function Send ( _
    request As Byte() _
) As Byte()
protected:
virtual array<unsigned char>^ Send (
    array<unsigned char>^ request
) override
Parameters
request (Byte []())
The request
Return Value
The reply as a byte-array, or null


NxtBrick Class

MindSqualls v1.2 beta 1 documentation
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.
 | NxtBrickNew(String) | Constructor.
 | BatteryLevel | The battery level of the NXT brick in millivolts.
 | CommLink | The communication link to the NXT brick.
 | 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 null if no program is running. Set the property to a program name to run the program, or to null to stop any running 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() | Stops 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

MindSqualls v1.2 beta 1 documentation
NxtBrick Constructor
Namespaces > NKH.MindSqualls > NxtBrick > NxtBrickNew
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot
Members
Icon | Member | Description
 | NxtBrickNew(Byte) | Constructor.
 | NxtBrickNew(String) | Constructor.


NxtBrick Constructor (serialPortNo)

MindSqualls v1.2 beta 1 documentation
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


NxtBrick Constructor (serialPortName)

MindSqualls v1.2 beta 1 documentation
NxtBrick Constructor (serialPortName)
Namespaces > NKH.MindSqualls > NxtBrick > NxtBrickNew(String)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Constructor.

Syntax
C# Visual Basic Managed C++
public NxtBrick (
    string serialPortName
)
Public Sub New ( _
    serialPortName As String _
)
public:
NxtBrick (
    String^ serialPortName
)
Parameters
serialPortName (String)
The COM port used by the Bluetooth link


BatteryLevel Property

MindSqualls v1.2 beta 1 documentation
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 in 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

MindSqualls v1.2 beta 1 documentation
CommLink Property
Namespaces > NKH.MindSqualls > NxtBrick > CommLink
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The communication link to the NXT brick.

Syntax
C# Visual Basic Managed C++
public NxtCommunicationProtocol CommLink { get; }
Public ReadOnly Property CommLink As NxtCommunicationProtocol
public:
NxtCommunicationProtocol^ CommLink {
    NxtCommunicationProtocol^ get ();
}
Remarks

The current version of the API only supports bluetooth links. Possibly a future version will support USB as well.

Exceptions
Exception | Condition
NxtConnectionException | Throws a NxtConnectionException if not connected.
See Also
Connect()
Disconnect()
IsConnected


Connect Method

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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);
}
Remarks

For some reason only the first 8 characters is remembered when the NXT is turned off. This is with version 1.4 of the firmware, and it may be fixed with newer versions.


PlaySoundfile Method (soundFile)

MindSqualls v1.2 beta 1 documentation
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)

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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 null if no program is running.

Set the property to a program name to run the program, or to null to stop any running 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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

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

Stops all playing sound; sound files and tones.

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


NxtCommand Enumeration

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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
 | Send(Byte[]()) | Send a request to the NXT brick, and return a reply.
 | 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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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)

MindSqualls v1.2 beta 1 documentation
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)

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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)

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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)

MindSqualls v1.2 beta 1 documentation
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 Nullable<NxtFindFileReply> FindFirst (
    string fileName
)
Public Function FindFirst ( _
    fileName As String _
) As Nullable(Of NxtFindFileReply)
public:
Nullable<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)

MindSqualls v1.2 beta 1 documentation
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 Nullable<NxtFindFileReply> FindNext (
    byte handle
)
Public Function FindNext ( _
    handle As Byte _
) As Nullable(Of NxtFindFileReply)
public:
Nullable<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

MindSqualls v1.2 beta 1 documentation
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 Nullable<ushort> GetBatteryLevel ()
Public Function GetBatteryLevel As Nullable(Of UShort)
public:
Nullable<unsigned short> GetBatteryLevel ()
Return Value
Voltage in millivolts
Remarks

Reference: BDK, Appendix 2, p. 9.


GetCurrentProgramName Method

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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 Nullable<NxtGetDeviceInfoReply> GetDeviceInfo ()
Public Function GetDeviceInfo As Nullable(Of NxtGetDeviceInfoReply)
public:
Nullable<NxtGetDeviceInfoReply> GetDeviceInfo ()
Return Value
A NxtGetDeviceInfoReply containing the parsed result
Remarks

Reference: BDK, Appendix 1, p. 14.

For some reason only the first 8 characters of the BXT name is remembered when the NXT is turned off. This is with version 1.4 of the firmware, and it may be fixed with newer versions.


GetFirmwareVersion Method

MindSqualls v1.2 beta 1 documentation
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 Nullable<NxtGetFirmwareVersionReply> GetFirmwareVersion ()
Public Function GetFirmwareVersion As Nullable(Of NxtGetFirmwareVersionReply)
public:
Nullable<NxtGetFirmwareVersionReply> GetFirmwareVersion ()
Return Value
A NxtGetFirmwareVersionReply with the protocol-, and the firmware versions.
Remarks

Reference: BDK, Appendix 1, p. 11.


GetInputValues Method (sensorPort)

MindSqualls v1.2 beta 1 documentation
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 Nullable<NxtGetInputValuesReply> GetInputValues (
    NxtSensorPort sensorPort
)
Public Function GetInputValues ( _
    sensorPort As NxtSensorPort _
) As Nullable(Of NxtGetInputValuesReply)
public:
Nullable<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)

MindSqualls v1.2 beta 1 documentation
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 Nullable<NxtGetOutputStateReply> GetOutputState (
    NxtMotorPort motorPort
)
Public Function GetOutputState ( _
    motorPort As NxtMotorPort _
) As Nullable(Of NxtGetOutputStateReply)
public:
Nullable<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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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 Nullable<uint> KeepAlive ()
Public Function KeepAlive As Nullable(Of UInteger)
public:
Nullable<unsigned int> KeepAlive ()
Return Value
Current sleep time limit, ms
Remarks

Reference: BDK, Appendix 2, p. 10.


LsGetStatus Method (sensorPort)

MindSqualls v1.2 beta 1 documentation
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 Nullable<byte> LsGetStatus (
    NxtSensorPort sensorPort
)
Public Function LsGetStatus ( _
    sensorPort As NxtSensorPort _
) As Nullable(Of Byte)
public:
Nullable<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)

MindSqualls v1.2 beta 1 documentation
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)

MindSqualls v1.2 beta 1 documentation
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)

MindSqualls v1.2 beta 1 documentation
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)

MindSqualls v1.2 beta 1 documentation
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)

MindSqualls v1.2 beta 1 documentation
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 Nullable<NxtOpenAppendDataReply> OpenAppendData (
    string fileName
)
Public Function OpenAppendData ( _
    fileName As String _
) As Nullable(Of NxtOpenAppendDataReply)
public:
Nullable<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)

MindSqualls v1.2 beta 1 documentation
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 Nullable<NxtOpenReadReply> OpenRead (
    string fileName
)
Public Function OpenRead ( _
    fileName As String _
) As Nullable(Of NxtOpenReadReply)
public:
Nullable<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)

MindSqualls v1.2 beta 1 documentation
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 Nullable<uint> OpenReadLinear (
    string fileName
)
Public Function OpenReadLinear ( _
    fileName As String _
) As Nullable(Of UInteger)
public:
Nullable<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)

MindSqualls v1.2 beta 1 documentation
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 Nullable<byte> OpenWrite (
    string fileName,
    uint fileSize
)
Public Function OpenWrite ( _
    fileName As String, _
    fileSize As UInteger _
) As Nullable(Of Byte)
public:
Nullable<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)

MindSqualls v1.2 beta 1 documentation
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 Nullable<byte> OpenWriteData (
    string fileName,
    uint fileSize
)
Public Function OpenWriteData ( _
    fileName As String, _
    fileSize As UInteger _
) As Nullable(Of Byte)
public:
Nullable<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)

MindSqualls v1.2 beta 1 documentation
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 Nullable<byte> OpenWriteLinear (
    string fileName,
    uint fileSize
)
Public Function OpenWriteLinear ( _
    fileName As String, _
    fileSize As UInteger _
) As Nullable(Of Byte)
public:
Nullable<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)

MindSqualls v1.2 beta 1 documentation
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)

MindSqualls v1.2 beta 1 documentation
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)

MindSqualls v1.2 beta 1 documentation
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)

MindSqualls v1.2 beta 1 documentation
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 Nullable<byte> PollCommandLength (
    byte bufferNo
)
Public Function PollCommandLength ( _
    bufferNo As Byte _
) As Nullable(Of Byte)
public:
Nullable<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)

MindSqualls v1.2 beta 1 documentation
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)

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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)

MindSqualls v1.2 beta 1 documentation
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 Nullable<NxtRequestModuleReply> RequestFirstModule (
    string resourceName
)
Public Function RequestFirstModule ( _
    resourceName As String _
) As Nullable(Of NxtRequestModuleReply)
public:
Nullable<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)

MindSqualls v1.2 beta 1 documentation
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 Nullable<NxtRequestModuleReply> RequestNextModule (
    byte handle
)
Public Function RequestNextModule ( _
    handle As Byte _
) As Nullable(Of NxtRequestModuleReply)
public:
Nullable<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)

MindSqualls v1.2 beta 1 documentation
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)

MindSqualls v1.2 beta 1 documentation
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.


Send Method (request)

MindSqualls v1.2 beta 1 documentation
Send Method (request)
Namespaces > NKH.MindSqualls > NxtCommunicationProtocol > Send(Byte[]())
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Send a request to the NXT brick, and return a reply.

Syntax
C# Visual Basic Managed C++
protected abstract byte[] Send (
    byte[] request
)
Protected MustOverride Function Send ( _
    request As Byte() _
) As Byte()
protected:
virtual array<unsigned char>^ Send (
    array<unsigned char>^ request
) abstract
Parameters
request (Byte []())
The request to the NXT brick
Return Value
The reply from the NXT brick, or null


SetBrickName Method (brickName)

MindSqualls v1.2 beta 1 documentation
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.

For some reason only the first 8 characters is remembered when the NXT is turned off. This is with version 1.4 of the firmware, and it may be fixed with newer versions.


SetInputMode Method (sensorPort, sensorType, sensorMode)

MindSqualls v1.2 beta 1 documentation
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)

MindSqualls v1.2 beta 1 documentation
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)

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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)

MindSqualls v1.2 beta 1 documentation
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 Nullable<ushort> Write (
    byte handle,
    byte[] data
)
Public Function Write ( _
    handle As Byte, _
    data As Byte() _
) As Nullable(Of UShort)
public:
Nullable<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)

MindSqualls v1.2 beta 1 documentation
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 Nullable<ushort> WriteIoMap (
    uint moduleId,
    ushort offset,
    byte[] ioMapContent
)
Public Function WriteIoMap ( _
    moduleId As UInteger, _
    offset As UShort, _
    ioMapContent As Byte() _
) As Nullable(Of UShort)
public:
Nullable<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

MindSqualls v1.2 beta 1 documentation
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)

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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 ...


NxtConnectionException Class

MindSqualls v1.2 beta 1 documentation
NxtConnectionException Class
Namespaces > NKH.MindSqualls > NxtConnectionException
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot
... TBD ...
Syntax
C# Visual Basic Managed C++
public class NxtConnectionException : NxtException
Public Class NxtConnectionException _
    Inherits NxtException
public ref class NxtConnectionException : public NxtException
Members
All Members | Constructors | Methods | Properties | Fields | Events
Public Protected |  | Instance Static |  | Declared Inherited
Icon | Member | Description
 | NxtConnectionExceptionNew(String) | ... TBD ...
 | 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
 |  |  |  | NxtConnectionException


NxtConnectionException Constructor (Message)

MindSqualls v1.2 beta 1 documentation
NxtConnectionException Constructor (Message)
Namespaces > NKH.MindSqualls > NxtConnectionException > NxtConnectionExceptionNew(String)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot
... TBD ...
Syntax
C# Visual Basic Managed C++
public NxtConnectionException (
    string Message
)
Public Sub New ( _
    Message As String _
)
public:
NxtConnectionException (
    String^ Message
)
Parameters
Message (String)

[Missing <param> documentation for "Message"]


NxtDigitalSensor Class

MindSqualls v1.2 beta 1 documentation
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 (Inherited from NxtSensor.)
 | PollInterval | Indicates if the sensor, 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.
 | sensorPort | The port the sensor is attached to. (Inherited from NxtSensor.)
 | sensorType | The type of the sensor. (Inherited from NxtSensor.)
 | 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
 |  |  |  | HiTechnicAccelerationSensor
See Also
NxtActiveSensor
NxtPassiveSensor


NxtDigitalSensor Constructor

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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
 |  |  |  | NxtConnectionException
 |  |  |  | NxtCommunicationProtocolException


NxtException Constructor (Message)

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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().)
 | pollData | The data from the previous poll of the sensor. (Inherited from NxtPassiveSensor.)
 | PollInterval | Indicates if the sensor, or motor, is auto-polled or not. (Inherited from NxtPollable.)
 | sensorPort | The port the sensor is attached to. (Inherited from NxtSensor.)
 | sensorType | The type of the sensor. (Inherited from NxtSensor.)
 | ToString() | Returns a String that represents the current Object. (Inherited from Object.)
Inheritance Hierarchy
Object
 | NxtPollable
 |  | NxtSensor
 |  |  | NxtPassiveSensor
 |  |  |  | NxtLightSensor


NxtLightSensor Constructor

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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 Nullable<byte> Intensity { get; }
Public ReadOnly Property Intensity As Nullable(Of Byte)
public:
Nullable<unsigned char> Intensity {
    Nullable<unsigned char> get ();
}


OnAboveIntensity Event

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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.
 | NxtMotorNew(Boolean) | 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.)
 | OnAboveTachoCount | This event is fired when the tachocount of the motor goes above the trigger-value.
 | OnBelowTachoCount | This event is fired when the tachocount of the motor goes below the trigger-value.
 | OnPolled | This event is fired when the sensor, or motor, is polled. (Inherited from NxtPollable.)
 | Poll() | Poll the motor. (Overrides NxtPollable.Poll().)
 | pollData | The data from the previous poll of the motor.
 | PollInterval | Indicates if the sensor, or motor, is auto-polled or not. (Inherited from NxtPollable.)
 | ResetMotorPosition(Boolean) | Resets the motors tachometer.
 | 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.)
 | TriggerTachoCount | Trigger value for the tachocount.
Inheritance Hierarchy
Object
 | NxtPollable
 |  | NxtMotor
See Also
NxtMotorSync


NxtMotor Constructor

MindSqualls v1.2 beta 1 documentation
NxtMotor Constructor
Namespaces > NKH.MindSqualls > NxtMotor > NxtMotorNew
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot
Members
Icon | Member | Description
 | NxtMotorNew() | Constructor.
 | NxtMotorNew(Boolean) | Constructor.


NxtMotor Constructor

MindSqualls v1.2 beta 1 documentation
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 ()


NxtMotor Constructor (reverse)

MindSqualls v1.2 beta 1 documentation
NxtMotor Constructor (reverse)
Namespaces > NKH.MindSqualls > NxtMotor > NxtMotorNew(Boolean)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Constructor.

Syntax
C# Visual Basic Managed C++
public NxtMotor (
    bool reverse
)
Public Sub New ( _
    reverse As Boolean _
)
public:
NxtMotor (
    bool reverse
)
Parameters
reverse (Boolean)
Indicates if the motor-direction should be reversed.


Brake Method

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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 ()


OnAboveTachoCount Event

MindSqualls v1.2 beta 1 documentation
OnAboveTachoCount Event
Namespaces > NKH.MindSqualls > NxtMotor > OnAboveTachoCount
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

This event is fired when the tachocount of the motor goes above the trigger-value.

Syntax
C# Visual Basic Managed C++
public event NxtMotorEvent OnAboveTachoCount
Public Event OnAboveTachoCount As NxtMotorEvent
public:
 event NxtMotorEvent^ OnAboveTachoCount {
    void add (NxtMotorEvent^ value);
    void remove (NxtMotorEvent^ value);
}
See Also
TriggerTachoCount
OnBelowTachoCount
Poll()


OnBelowTachoCount Event

MindSqualls v1.2 beta 1 documentation
OnBelowTachoCount Event
Namespaces > NKH.MindSqualls > NxtMotor > OnBelowTachoCount
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

This event is fired when the tachocount of the motor goes below the trigger-value.

Syntax
C# Visual Basic Managed C++
public event NxtMotorEvent OnBelowTachoCount
Public Event OnBelowTachoCount As NxtMotorEvent
public:
 event NxtMotorEvent^ OnBelowTachoCount {
    void add (NxtMotorEvent^ value);
    void remove (NxtMotorEvent^ value);
}
See Also
TriggerTachoCount
OnAboveTachoCount
Poll()


Poll Method

MindSqualls v1.2 beta 1 documentation
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


pollData Field

MindSqualls v1.2 beta 1 documentation
pollData Field
Namespaces > NKH.MindSqualls > NxtMotor > pollData
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The data from the previous poll of the motor.

Syntax
C# Visual Basic Managed C++
protected Nullable<NxtGetOutputStateReply> pollData
Protected pollData As Nullable(Of NxtGetOutputStateReply)
protected:
Nullable<NxtGetOutputStateReply> pollData


ResetMotorPosition Method (relative)

MindSqualls v1.2 beta 1 documentation
ResetMotorPosition Method (relative)
Namespaces > NKH.MindSqualls > NxtMotor > ResetMotorPosition(Boolean)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Resets the motors tachometer.

Syntax
C# Visual Basic Managed C++
public void ResetMotorPosition (
    bool relative
)
Public Sub ResetMotorPosition ( _
    relative As Boolean _
)
public:
void ResetMotorPosition (
    bool relative
)
Parameters
relative (Boolean)
True if the reset is relative to the last movement, false if the absolute position
See Also
ResetMotorPosition()


Run Method (power, tachoLimit)

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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 Nullable<int> TachoCount { get; }
Public ReadOnly Property TachoCount As Nullable(Of Integer)
public:
Nullable<int> TachoCount {
    Nullable<int> get ();
}


TriggerTachoCount Property

MindSqualls v1.2 beta 1 documentation
TriggerTachoCount Property
Namespaces > NKH.MindSqualls > NxtMotor > TriggerTachoCount
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Trigger value for the tachocount.

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


NxtMotorEvent Delegate

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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.)
 | ResetMotorPosition(Boolean) | Calls ResetMotorPosition() on both motors.
 | 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)

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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 ()


ResetMotorPosition Method (relative)

MindSqualls v1.2 beta 1 documentation
ResetMotorPosition Method (relative)
Namespaces > NKH.MindSqualls > NxtMotorSync > ResetMotorPosition(Boolean)
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Calls ResetMotorPosition() on both motors.

Syntax
C# Visual Basic Managed C++
public void ResetMotorPosition (
    bool relative
)
Public Sub ResetMotorPosition ( _
    relative As Boolean _
)
public:
void ResetMotorPosition (
    bool relative
)
Parameters
relative (Boolean)
True if the reset is relative to the last movement, false if the absolute position
See Also
ResetMotorPosition()


Run Method (power, tachoLimit, turnRatio)

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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 NxtSensor.Poll().)
 | PollInterval | Indicates if the sensor, or motor, is auto-polled or not. (Inherited from NxtPollable.)
 | sensorPort | The port the sensor is attached to. (Inherited from NxtSensor.)
 | sensorType | The type of the sensor. (Inherited from NxtSensor.)
 | ToString() | Returns a String that represents the current Object. (Inherited from Object.)
Inheritance Hierarchy
Object
 | NxtPollable
 |  | NxtSensor
 |  |  | NxtNoSensor


NxtNoSensor Constructor

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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 NxtSensor.Poll().)
 | pollData | The data from the previous poll of the sensor.
 | PollInterval | Indicates if the sensor, or motor, is auto-polled or not. (Inherited from NxtPollable.)
 | sensorPort | The port the sensor is attached to. (Inherited from NxtSensor.)
 | sensorType | The type of the sensor. (Inherited from NxtSensor.)
 | 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)

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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


pollData Field

MindSqualls v1.2 beta 1 documentation
pollData Field
Namespaces > NKH.MindSqualls > NxtPassiveSensor > pollData
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The data from the previous poll of the sensor.

Syntax
C# Visual Basic Managed C++
protected Nullable<NxtGetInputValuesReply> pollData
Protected pollData As Nullable(Of NxtGetInputValuesReply)
protected:
Nullable<NxtGetInputValuesReply> pollData


NxtPollable Class

MindSqualls v1.2 beta 1 documentation
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.

Remarks

This class has been modified from using System.Timers.Timer (in versions 1.0 and 1.1) to using System.Threading.Timer in order to be able to function with the compact framework (i.e. to run on a PDA). A special thanks to Giorgio T. for his suggestion.

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() | 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.
 | Poll() | Poll the sensor/motor.
 | PollInterval | Indicates if the sensor, 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

MindSqualls v1.2 beta 1 documentation
NxtPollable Constructor
Namespaces > NKH.MindSqualls > NxtPollable > NxtPollableNew()
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Constructor.

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


OnPolled Event

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
PollInterval Property
Namespaces > NKH.MindSqualls > NxtPollable > PollInterval
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

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

Syntax
C# Visual Basic Managed C++
public int PollInterval { get; set; }
Public Property PollInterval As Integer
public:
int PollInterval {
    int get ();
    void set (int 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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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 (Overrides NxtPollable.Poll().)
 | PollInterval | Indicates if the sensor, or motor, is auto-polled or not. (Inherited from NxtPollable.)
 | sensorPort | The port the sensor is attached to.
 | sensorType | The type of the sensor.
 | 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)

MindSqualls v1.2 beta 1 documentation
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


Poll Method

MindSqualls v1.2 beta 1 documentation
Poll Method
Namespaces > NKH.MindSqualls > NxtSensor > 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


sensorPort Field

MindSqualls v1.2 beta 1 documentation
sensorPort Field
Namespaces > NKH.MindSqualls > NxtSensor > sensorPort
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The port the sensor is attached to.

Syntax
C# Visual Basic Managed C++
protected NxtSensorPort sensorPort
Protected sensorPort As NxtSensorPort
protected:
NxtSensorPort sensorPort


sensorType Field

MindSqualls v1.2 beta 1 documentation
sensorType Field
Namespaces > NKH.MindSqualls > NxtSensor > sensorType
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The type of the sensor.

Syntax
C# Visual Basic Managed C++
protected NxtSensorType sensorType
Protected sensorType As NxtSensorType
protected:
NxtSensorType sensorType


NxtSensorEvent Delegate

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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 | Indicating 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().)
 | pollData | The data from the previous poll of the sensor. (Inherited from NxtPassiveSensor.)
 | PollInterval | Indicates if the sensor, or motor, is auto-polled or not. (Inherited from NxtPollable.)
 | sensorPort | The port the sensor is attached to. (Inherited from NxtSensor.)
 | sensorType | The type of the sensor. (Inherited from NxtSensor.)
 | 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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
dBA Property
Namespaces > NKH.MindSqualls > NxtSoundSensor > dBA
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Indicating 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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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 Nullable<byte> SoundLevel { get; }
Public ReadOnly Property SoundLevel As Nullable(Of Byte)
public:
Nullable<unsigned char> SoundLevel {
    Nullable<unsigned char> get ();
}
See Also
dBA


NxtTouchSensor Class

MindSqualls v1.2 beta 1 documentation
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().)
 | pollData | The data from the previous poll of the sensor. (Inherited from NxtPassiveSensor.)
 | PollInterval | Indicates if the sensor, or motor, is auto-polled or not. (Inherited from NxtPollable.)
 | sensorPort | The port the sensor is attached to. (Inherited from NxtSensor.)
 | sensorType | The type of the sensor. (Inherited from NxtSensor.)
 | ToString() | Returns a String that represents the current Object. (Inherited from Object.)
Inheritance Hierarchy
Object
 | NxtPollable
 |  | NxtSensor
 |  |  | NxtPassiveSensor
 |  |  |  | NxtTouchSensor


NxtTouchSensor Constructor

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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 Nullable<bool> IsPressed { get; }
Public ReadOnly Property IsPressed As Nullable(Of Boolean)
public:
Nullable<bool> IsPressed {
    Nullable<bool> get ();
}


OnPressed Event

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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.
 | 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 trigger distance.
 | OnOutsideDistance | This event is fired if the sensor does not detect an object within the trigger 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 NxtSensor.Poll().)
 | pollData | The data from the previous poll of the sensor.
 | PollInterval | Indicates if the sensor, 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.
 | sensorPort | The port the sensor is attached to. (Inherited from NxtSensor.)
 | sensorType | The type of the sensor. (Inherited from NxtSensor.)
 | 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.)
 | TriggerDistanceCm | Trigger distance.
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

MindSqualls v1.2 beta 1 documentation
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 ()


ContinuousMeasurementCommand Method

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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 Nullable<byte> DistanceCm { get; }
Public ReadOnly Property DistanceCm As Nullable(Of Byte)
public:
Nullable<unsigned char> DistanceCm {
    Nullable<unsigned char> get ();
}


EventCaptureCommand Method

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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 trigger 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
TriggerDistanceCm
OnOutsideDistance
Poll()


OnOutsideDistance Event

MindSqualls v1.2 beta 1 documentation
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 trigger 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
TriggerDistanceCm
OnInsideDistance
Poll()


Poll Method

MindSqualls v1.2 beta 1 documentation
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
TriggerDistanceCm
OnInsideDistance
OnOutsideDistance


pollData Field

MindSqualls v1.2 beta 1 documentation
pollData Field
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > pollData
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

The data from the previous poll of the sensor.

Syntax
C# Visual Basic Managed C++
protected Nullable<byte> pollData
Protected pollData As Nullable(Of Byte)
protected:
Nullable<unsigned char> pollData
See Also
Poll()


ReadActualScaleDivisor Method

MindSqualls v1.2 beta 1 documentation
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 Nullable<byte> ReadActualScaleDivisor ()
Public Function ReadActualScaleDivisor As Nullable(Of Byte)
public:
Nullable<unsigned char> ReadActualScaleDivisor ()
Return Value
... TBD ...
See Also
SetActualScaleDivisor(Byte)


ReadActualScaleFactor Method

MindSqualls v1.2 beta 1 documentation
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 Nullable<byte> ReadActualScaleFactor ()
Public Function ReadActualScaleFactor As Nullable(Of Byte)
public:
Nullable<unsigned char> ReadActualScaleFactor ()
Return Value
... TBD ...
See Also
SetActualScaleFactor(Byte)


ReadActualZero Method

MindSqualls v1.2 beta 1 documentation
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 Nullable<byte> ReadActualZero ()
Public Function ReadActualZero As Nullable(Of Byte)
public:
Nullable<unsigned char> ReadActualZero ()
Return Value
... TBD ...
See Also
SetActualZero(Byte)


ReadCommandState Method

MindSqualls v1.2 beta 1 documentation
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 Nullable<byte> ReadCommandState ()
Public Function ReadCommandState As Nullable(Of Byte)
public:
Nullable<unsigned char> ReadCommandState ()
Return Value
... TBD ...


ReadContinuousMeasurementsInterval Method

MindSqualls v1.2 beta 1 documentation
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 Nullable<byte> ReadContinuousMeasurementsInterval ()
Public Function ReadContinuousMeasurementsInterval As Nullable(Of Byte)
public:
Nullable<unsigned char> ReadContinuousMeasurementsInterval ()
Return Value
... TBD ...
See Also
ContinuousMeasurementCommand()
SetContinuousMeasurementInterval(Byte)


ReadFactoryScaleDivisor Method

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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)

MindSqualls v1.2 beta 1 documentation
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 Nullable<byte> ReadMeasurementByteX (
    byte x
)
Public Function ReadMeasurementByteX ( _
    x As Byte _
) As Nullable(Of Byte)
public:
Nullable<unsigned char> ReadMeasurementByteX (
    unsigned char x
)
Parameters
x (Byte)
The byte no.
Return Value
... TBD ...


ReadMeasurementUnits Method

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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)

MindSqualls v1.2 beta 1 documentation
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)

MindSqualls v1.2 beta 1 documentation
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)

MindSqualls v1.2 beta 1 documentation
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)

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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()


TriggerDistanceCm Property

MindSqualls v1.2 beta 1 documentation
TriggerDistanceCm Property
Namespaces > NKH.MindSqualls > NxtUltrasonicSensor > TriggerDistanceCm
MindSqualls is a .Net 2.0 library for the LEGO MINDSTORMS NXT robot

Trigger distance.

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


Polled Delegate

MindSqualls v1.2 beta 1 documentation
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

MindSqualls v1.2 beta 1 documentation
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.