Archive for the ‘Programming’ Category

Summer Camp + LEGO + DMA = An NXT Robotics Course at Stanford University

Tuesday, June 24th, 2008

Starting July 28th, I’ll be teaching a week-long robotics course for teenagers at Stanford University using LEGO MINDSTORMS NXT. The course, “Hands-On Robotics for Teens,” is one of many technology courses being offered this summer by DMA (Digital Media Academy), a nationally-recognized organization that runs summer computer camps at campuses across the nation. I’ve written a course description and put together a five-day course outline, and DMA has posted the information to their website.

The entire course will be “NXT-based.” We’ll be using the educational version of the NXT set and also the Education Resource Set.  And what’s the highlight of the course? I think it will be the robotic sumo competition!

The course is for teenagers (ages 13-19), and if you’re interested in signing up for the course (or have a teen who may be interested), you can find out more about registration at the DMA website.

I’m definitely excited. After all, what’s a summer without a robotic sumo competition?


Second Edition of Maximum LEGO NXT Book

Thursday, May 29th, 2008

I recently posted about an updated version of the leJOS NXJ language that was released, and I’ve also recently learned that a second edition of Brian Bagnall’s book Maximum LEGO NXT: Building Robots with Java Brains is being published this September. You can pre-order the book at, which currently has the following description posted:

Featuring updated instructions for the improved leJOS NXJ software, this accessible manual is the perfect guide to LEGO Mindstorms NXT, an incredible new kit for building and programming your own robots. Using Java, the most popular and easy-to-use programming language available, this manual helps engineers and amateurs alike design and build their own customized robots, programmed however they desire. Complete with a diverse set of projects, building tips, programming codes, complete 3D-rendered building instructions, and hundreds of illustrations, this useful handbook is the perfect complement to the LEGO NXT kit. The NXT intelligent brick’s Bluetooth capabilities are introduced as well as the newest available parts, including the gyro and the RFID sensor.

I’m looking forward to the second edition, Brian!

Second Edition of Maximum LEGO NXT

leJOS NXJ Version 0.6 Released

Saturday, May 10th, 2008

If you’re a Java fan, you will be excited to hear that version 0.6 of leJOS NXJ was recently released. This release finally brings full Max OS X support as well as a number of other fixes and new features. You can download it here.


Great NXT Projects at

Monday, February 18th, 2008

Dave Parker’s website,, is an absolutely outstanding resource. On his website, you’ll find a multitude of projects with building and programming instructions. The pictures for the building instructions are very clear and well done. He has several categories of creations:

  • Fun and Games
  • Music and Sound
  • Cars and Vehicles
  • Weapons
  • Machines
  • Sensor systems
  • Animals

The “Rattlesnake” creation under the “Animals” category is one of my favorites. Sometimes when I’m showing kids my robots, I’ll say, “Don’t worry–it doesn’t bite.” I couldn’t say that with this robot!


Using the Motor Power Meter Block with Tag-Bot

Wednesday, January 23rd, 2008

A reader (Nathan G.) of The ULMN Inventor’s Guide recently wrote me about an NXT-G program he was working on for Tag-Bot. The program’s purpose was to solve Tag-Bot’s inability to determine its steering position. In the book, I simply instruct readers to always center the robot’s steering before starting a program—the robot then assumes that its steering has been centered. The reader used an unofficial NXT-G block, the Motor Power Meter block, to fix the problem.

Motor Power Meter NXT-G Block

What does this enormously helpful block do? The repository on reports the following:

This block is a “sensor” which allows you to monitor the actual power sent to the NXT servo motor. In a single motor mode (Motor block) with “Motor Power” enabled the firmware automatically increases the power to keep constant speed. Monitoring the ”Actual Power” allows detecting stall conditions as well as slip conditions (e.g. when your robot hits the wall, its motors might still be able to slip in place but the robot does not move).

I modified Nathan’s program some, but the basic idea remains the same. Using the Power Meter option within the standard Wait block to determine a stall condition, Tag-Bot first steers to the rightmost position and then resets the built-in rotation sensor of the steering motor (Motor A). Next, it steers to the leftmost position and then divides the current value of Motor A’s rotation sensor by 2. The quotient is the number of degrees that the steering motor should turn to center the steering. Voilà! Automatic steering. You can start the program with Tag-Bot’s steering in any position, and it should always be able to center it.

If you’d like to download the mini-program shown below, click here. Remember that you have to download the Motor Power Meter block if you want to use this program.


NXT-G programs from Chapter 8 now available

Tuesday, December 11th, 2007

After receiving an email from a reader who had put together one of the programs shown in Chapter 8, “Advanced NXT-G Programming,” I decided to make the programs available to everyone. Although the programs shown in that chapter were only supposed to clarify the concepts being described (i.e., the reader is not expected to test the programs), experimenting with the programs is fun! You can download them from the following page on the book’s companion website:

Sample NXT-G Program

New NBC/NXC Version Available

Tuesday, November 27th, 2007

I programmed extensively in the NQC (Not Quite C) programming language for the RCX microcomputer. That’s why I’m glad to see that John Hansen is working hard on the NXC (Not eXactly C) language, which is very much like NQC. In addition, he is simultaneously developing the NBC (Next Byte Codes) language.

Beta version 34 of the software is now available, released November 25th. Click here to get the update. Or you can download the latest version of the BricxCC IDE, which also includes the latest version of NBC/NXC.

The BricxCC IDE