Mindstorms NXT: Introduction to NXC Programming

Mindstorms NXT: Introduction to NXC Programming with the Brick Command Center (Bricxcc)

Introduction

The Brick Command Center is an Integrated Development Environment (or IDE for short) for programming robots including the Lego Mindstorms NXT using text based languages such as the language 'Not Exactly C' or NXC.

In computer programming, we talk about the floor and the ceiling of a language.

The floor describes the amount of learning you must do before you can write something useful.

The ceiling describes the complexity of the program you can write before you hit the limits of the language.

The graphical programming tool that comes with the Mindstorms NXT kits, NXT-G has a low floor (it's easy to get started) but a low ceiling (there are limits on what can be achieved with the language.)

Not Exactly C (or NXC for short) is much harder to learn than NXT-G, but once the basics have been mastered, there are fewer limits on what can be achieved.

This serious of talk-throughs will teach you the basics of programming the Lego Mindstorms NXT using NXC and the Brick Command Center.

Be warned - this is hard, but once mastered you will enjoy the power of the language.

Resources You Will Need

Brick Command Center download (from Club Engineer website) If you are starting out, this is the best place to get the Brick Command Center software. Click the link and a setup exe will download. Run the exe and, as long as you have local administrator rigthts to your pc, bricxcc will install.

Brick Command Center software as a zip file Many schools do not allow software to be installed onto school computers. If this is the case then you will not be able to install the bricxcc using the setup program above. Try downloading this zip file and decompressing to a folder in the root of C:\, or My Documents.

Brick Command Center Home Page (on SourceForge) The Brick Command Center software is hosted on SourceForge - a site used by developers for sharing open source software.

As you are working through these tutorials, you may find the NXC Cheat Sheet helpful to trigger your memory.

Talk-through #1a - Installing the Brick Command Center - From the Installer

Talk-through #1b - Installing the Brick Command Center - From the zip file

 Talk-through #2 - The structure of a program - 'Hello World'. Compile, upload & run

 Talk-through #3 - Draw a border using code templates

 Talk-through #4 - Flashing text on the screen - by copying code

 Talk-through #5 - Flashing text on the screen - by using a repeat loop

 Talk-through #6 - Procedures and passing parameters, making code re-usable

 Talk-through #7 - Data types - string & int, and more parameters

 Talk-through #8 - Chaining procedures together

Talk-through #9 - The While Loop

Talk-through #10 - Calculate the x coordinate necessary to center the text

Talk-through #11 - Recap what we have covered

Toggle menu