Quicklinks

Download Program:simple-hello-world-nxt-robot.rbt
This Page as PDF:simple-hello-world-nxt-robot.pdf
Video:Youtube Video

Simple Hello World NXT Robot

Stefan Bracher

If you get your hands on an NXT robot for the first time, you want to get going as fast as possible. This robot is very simple to build and will allow you to have your first working robot within minutes. - And yes, it will display “Hello World” on the screen.

Simple Hello World NXT Robot

Video

Building the robot

Building the robot can take less than 3 minutes. You need the following material:

Material Overview

First, assemble a pole that acts as a "3rd wheel" to balance the robot.

Then, build the two wheels. (Do the following twice)

Finally, connect the wheels to the NXT. Make sure the cables are plugged in port B and port C of the NXT.

Program

Our NXT robot needs also a program. Otherwise it will just sit there and do nothing. A program is like a list of commands we give the robot to execute. For our program, it will look like in the picture below and contain the following commands:

NXT-G Code
  1. Move motors C and B for one rotation
  2. Play a sound
  3. Display "Hello World"

The programming language we are using to create this program is called NXT-G Code.


Create a new program

To create a new program, open the Mindstorms software and type the name of the program you want to create. Then click "GO".

Screenshot 1

Select the commands and build the program

From the left menu, grab the commands we want to use: "Move", "Play Sound", "Display" and create the chain of commands .

Screenshot 2a

Configure your commands

To configure your commands, click on them, one at a time.
For the "Move" command, the following menu will appear at the bottom of the screen:

Screenshot 2

In the port selection, we select where the motors are connected to. In our case, this is port B and C. This is the only thing we have to change here, as we will use the default settings for our first program.

In the configuration menu of the "Play sound" command (remember to click on the command in the program for the menu to appear), we can select the sound we want our robot to make.

Screenshot 3

Last but not least, we configure the “Display” command. Select “Text” in the Action field and type "Hello World" in the text field.

Screenshot 4

Download the program

Now you have to connect your robot to the computer. The easiest way is with the USB-Cable. Turn your robot on by clicking on the orange button. Finally, hit the download button.

usb1 usb2 Screenshot 5

Start the program

To start the program, do the following:

  1. Turn the robot on by clicking on the orange button: "My Files" should be displayed.
  2. Click the orange button again: "Software files" should be displayed.
  3. Click the orange button again: Now you should see the program you just downloaded. If there are several programs on the NXT, use the right and left arrows to browse to the program you want to start.
  4. Click the orange button again: "hello_world Run" should be displayed.
  5. Click the orange button one last time: The robots starts executing the commands in your program.

To turn of the robot, click the gray button until “Turn off?” is displayed. Now click the orange button to confirm and the robot will power off.

Start Run Stop