The MindSqualls library connects to the NXT brick using Bluetooth.
When I figure out how to do it, I plan to add USB support as well.
The communication channel to the NXT brick is handled by the two classes:
||Implements the NXT protocol|
||Implements the connection using Bluetooth.|
If, and when, I implements the USB support, it will most likely be in the form of
NxtUsbConnection implementing the
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 communicating with your NXT brick, this means that
you can make do with these three C# files:
The NxtBrick implements the brick itself. The brick has a
for the Bluetooth connection.
It also has a
mororArray 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
||(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.|