COSC 343 2010

Artificial Intelligence

Lego Resources

This page describes the new NXT mindstorms robots, and how to program them.

Background

We use Mindstorms NXT robots in COSC343. These robots use the 32-bit ARM7 microprocessor, and the 8-bit Atmel AVR microcontroller. Here's a rundown of the features of the Mindstorms NXT kits. You can find out more about the NXT system:

A hierarchy of programming languages

As with any computer system, there are several different levels on which you can interact with the NXT robots.

NXC

The language we'll be using on this course is called NXC (which stands for 'not exactly C'). You can find out everything you need about NXC on the NXC website. In particular: Note that every NXC program begins with a call to include a file of macro and constant definitions called NXCDefs.h .
#include "NXCDefs.h"
You probably won't have to look inside this file - just remember to include it as the first line in all your programs.

You can download the NXCDefs.h file from here.

Writing and installing a program using NXC

Assuming your firmware is installed, the basic development method you will be using is as follows:

The robot's control panel

You control your robot using a simple system of hierarchical menus. There are four buttons: 'left', 'right', 'okay' (the orange button) and 'back/delete' (the dark grey one). Kind of primitive, but if you managed to get used to texting, you should be able to get used to this too.

The top-level menu includes an option 'my files', which takes you to a primitive file system. At the top level of the file system is the option 'software files'; inside here you'll find your program. If you select it, you have the option of running it.

Once your robot's program is running, you can abort by hitting the dark grey button. Easier said than done when it's zipping along the carpet. I suggest you pick it up first.