MindSqualls is a .Net library for controlling a LEGO MINDSTORMS NXT or NXT 2.0 robot via either a Bluetooth- or an USB connection. It is written in C# and requires .Net v. 2.0 or newer.

In order to use it you will have to write your own .Net program and link to the DLL from there. You can use either C# or VB.Net or some other .Net language. It also works with the Compact Framework as well (you will have to recompile it of cause).

See some C# code examples here.

Currently Supports

The MindSqualls API v2.0 implements:

  • Full NXT 2.0 support, including the NXT 2.0 Color sensor.
  • USB support (as an alternative to Bluetooth).
  • Verified to work with at least some of the RCX sensors.
  • Can be used with .Net 2.0 through .Net 4.0 and VS 2010.
  • Bug fixes.
  • Now licensed under LGPL v3.0.

The MindSqualls API v1.2 beta 1 implements:

  • Support for the HiTechnic NXT Acceleration / Tilt sensor.
  • Code will now run unchanged under the Compact Framework (i.e. you can use it with a PDA).
  • Keepalive timer added to the NxtBrick class. Keeps the bluetooth connection from timing out.
  • The framework now uses nullable returntypes wherever logical consistent.
  • The framework now has support for tracing (primarily for internal debugging).
  • The NxtMotor now has a reverse setting.
  • NXT-G like events reintroduced in the HiTechnicCompassSensor class. They had disappered in v1.1.
  • Various minor bugfixes.
  • Code generally hardened.

The MindSqualls API v1.1 implements:

  • Support for the HiTechnic NXT Color sensor.
  • It is now possible to read the TachoCount of a motor.
  • A new NxtNoSensor for those sensor ports you want to blank.
  • A lot of XML documentation.
  • Minor bug fixes.

The MindSqualls API v1.0 implements:

  • Bluetooth communication to and from the NXT robot (but not USB).
  • All commands from appendix 1 and 2 of the BDK (including all Direct commands).
  • Provides the programmer with, either a basic bluetooth link to the NXT, or encapsulated in the convenient NxtBrick class.
  • All NXT Sensors, including the Ultrasonic sensor.
  • The HiTechnic NXT Compass sensor.
  • NXT motors including support for synchronized motor-pairs.
  • Provides NXT-G alike events to hook up on.
  • Provides an easily extendable class-hierarchy.
  • Thorough documentation (from v1.1).


Ever since I bought my own NXT robot, I have been wanting to be able to control it from a C# program. I am not very happy with the NXT-G programming language, and the natural choice (to me at least) was to use C# instead. So I naturally googled for the Internet to see if I could find some C# examples, and found Bram Fokkes excellent NXT# project.

Unfortunately I suffer from the NIH syndrome, and so I had to make my own, and this is it. ;^)

While there are many similarities between NXT# and MindSqualls, there are also some notable differences. I am not going to go into details about this, since you probably does not care anyway. So, just a few highlights:

  • The class hierarchy differs somewhat between the two projects. The MindSqualls hierarchy is shown here.
  • Bram Fokke bases almost all his classes in the Component-class. This means that he can support the drag-and-drop style of programing used in Visual Studio. I have chosen not to do this.
  • The MindSqualls library support all the functions from the BDK document and its appendices (see item 2, under credits). Mind you, they have not all been tested.

Did You Know?

"LEGO" is in fact a concatenation of:

Le Go = Leg Godt (Danish) = Play Well

Well, Play Well!

Niels K. Handest
December 2006


Quick Start v1.1 (C#)
Quick Start v1.2 (C#)
Quick Start v2.0 (C#)
Samples (C#)
User Contributions
You People Using It
Legal Stuff


Tech stuff

Visit Steve Hassenplug's
NXT site for a list of similar tools.