The MindSqualls library connects to the NXT brick using either Bluetooth or USB.
The communication channel to the NXT brick is handled by 3 classes:
||Implements the NXT protocol.|
||Implements communicating with the NXT using Bluetooth.|
||Implements communicating with the NXT using USB. (new in v2.0)|
If an error occurs, these classes may throw a
NxtCommunicationProtocolException as well as ordinary .Net exceptions
ArgumentException. You will find the definition of these in the
If you are only interested in how to communicate with your NXT brick, it means that
you can make do with these 4-5 C# files:
The NxtBrick implements the brick itself. The brick has a
for the Bluetooth/USB connection.
It also has a
motorArray of 3 motors and a
of 4 sensors.
NxtPollable class has a
brick field and since
NxtSensor inherits this class, this provides the opposite relation.
||Implements common functionality for polling a sensor or a motor for sensor-input.|
||Implements the NXT brick.|
||Implements a NXT motor.|
||Implements a generic NXT sensor. This abstract class needs to be overridden for the specific types of NXT sensors.|
Note: In previous versions of the API, the
each implemented a
brick field. In v1.2 this field has been moved to
NxtPollable class. If you are interested you can see the class-rundown
for v1.1 here.
Both motors and sensors can be queried for information; The sensors can be polled for their sensor-readings (duh!), and the motor can be polled for their rotation count.
As a result the sensor class hierarchy starts with the
classes and includes the
NxtMotor class as well as the
class and its derived classes:
||(v1.2) Implements the Acceleration / Tilt Sensor sensor from HiTechnic.|
||Implements the Compass sensor from HiTechnic.|
||(v1.1) Implements the Color sensor from HiTechnic.|
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
So far there is no classes implementing the
||(v2.0) Implements the new Color sensor in the NXT 2.0 set.|
||(v1.1) Use this class if you need to blind a sensor port.|
||Implements the Light sensor. The sensor may provide its own light, or it may measure the ambient light.|
||Implements a pollable device for the NXT brick i.e. a device that can measurable something.|
||Implements the Sound sensor. Readings may be in both the dB and dBA scales.|
||Implements the Touch sensor.|
||Implements the Ultrasonic sensor. Readings is in cm units.|
The NXT brick provides supports for synchronizing two motors. This is practical since it makes it possible to drive the robot on a straight line, without one motor overtaking the other.
NxtMotorSync class handles this functionality.
||Establishes a relationship between two motors, allowing them to be synchronized.|