Here is a measuring wheel I made using the NXT and a mindsensors GlideWheel-AS. The NXT displays traveled distance in mm, cm, M, in, ft, or yd, and will automatically show the proper number of significant figures.

The only thing you have to modify in the code, is WHEEL_DIA (wheel diameter in mm), on line six. Note that nearly all (if not all) Lego technic tires have their size molded into the sidewall, in mm, in the format “diameter x width”; so the “RCX wheels” are “81.6 x 15”.

You can optionally modify AS_PORT and AS_ADDR as needed.

You will need the mindsensors library for the sensor, called “AngleSensor-lib.nxc”.

Here is a pong game I made for the NXT. It uses the NXTChuck to read a Wii Nunchuk, and uses the values as the user input to the game.
In the video I was using two NXTChucks and Nunchuks, in two-player game mode. If you want to play single-player, you can change just one line of the program so that it compiles for single-player mode.

You need to have the NXC NXTChuck library, available from Dexter Industries’ downloads page.

Lines 3 through 16 are constants that determine the characteristics of the game. Most of them are fairly self-explanatory. Try changing them, and don’t worry, I have listed all the original values in the program, so you can always change it back really easily. Line 16 tells the compiler to compile for 1 or for 2 controllers.

This is a scanner I made, using the new mindsensors LightSensorArray. The LSA (LightSensorArray) has 8 light sensors spaced about 6.5mm apart. I used a sideways moving scan head, so that I essentially double the scan width resolution (take a reading, move about 3.3mm sideways, and take another reading). At the end of the scan, you can upload the image (as a monochrome .bmp) to the computer, and open it using a photo viewer. The image is 16 pixels tall, and as many pixels wide as the number of rows you told the scanner to scan.

Here is a video of it scanning:

Here is the actual image it scanned while I was taking the video:

Scanned image (enlarged 6 times, and reformatted to png for uploading to the blog)

And here are a few pictures of the scanner:

Lego NXT LSA Scanner – Right

Lego NXT LSA Scanner – Left

Lego NXT LSA Scanner – Bottom

You can download the LSA library (called “LSA-lib.nxc”) from mindsensors.com.

Mindsensors is working on a new NXT sensor, called a Light Sensor Array. It’s similar in form factor to the LineLeader that they have sold previously, but it doesn’t have a PID algorithm built in. Instead, it just gives you access to the individual light sensors, and their binary states. The reason for this, is that the LineLeader was disqualified from many competitions, since it was too much of a “canned” line follower (it did all the necessary calculations on board).

I made a function that you can use to determine where a line is compared to the sensor. It returns a number from 10-80 based on where it “sees” the line. 45 is the middle, so you can compare the position to 45 to determine the offset from being centered on the line. 0 represents no line detected. Use this in conjunction with the LSA library provided by mindsensors.