Art of LEGO MINDSTORMS NXT-G Programming / Edition 1

Art of LEGO MINDSTORMS NXT-G Programming / Edition 1

by Terry Griffin
4.3 3
Pub. Date:
No Starch Press San Francisco, CA
Select a Purchase Option (NE)
  • purchase options

    Temporarily Out of Stock Online

    Note: Access code and/or supplemental material are not guaranteed to be included with textbook rental or used textbook.
  • purchase options
    $16.63 $29.95 Save 44% Current price is $16.63, Original price is $29.95. You Save 44%.
    Note: Access code and/or supplemental material are not guaranteed to be included with textbook rental or used textbook.


Art of LEGO MINDSTORMS NXT-G Programming / Edition 1

The LEGO® MINDSTORMS® software and its NXT-G programming language are powerful tools that make it easy to write custom programs for your robots. NXT-G is a great first programming language, but that doesn't mean it's easy to understand—at least not right away.

In The Art of LEGO MINDSTORMS NXT-G Programming , author and experienced software engineer Terry Griffin explains how to program MINDSTORMS robots with NXT-G. You'll learn how to work with the core parts of the NXT-G language, such as blocks, data wires, files, and variables, and see how these pieces can work together. You'll also learn good programming practices, bad habits to avoid, and useful debugging strategies.

As you follow along with the book's extensive instructions and explanations, you'll learn exactly how NXT-G works and how to:

  • Write custom programs that make your robots appear to think and respond to your commands
  • Design, create, and debug large programs
  • Write programs that use data wires and the NXT buttons to turn a robot into a contraption, like a sound generator or a sketch pad
  • Use My Blocks in your programs, and share them with others
  • Store data on the NXT, manage its memory, and transfer files between the NXT and your computer

The book's programs work with one general-purpose test robot that you'll build in Chapter 3.

Whether you're a young robotics enthusiast, an adult working with children to learn robotics, a parent, a FIRST LEGO League coach, or a teacher using NXT in the classroom, this is the complete guide to NXT-G that you've been looking for.

Requirements : One LEGO MINDSTORMS NXT or NXT 2.0 set

Product Details

ISBN-13: 2901593272189
Publisher: No Starch Press San Francisco, CA
Publication date: 09/15/2010
Edition description: NE
Pages: 288
Product dimensions: 6.00(w) x 1.25(h) x 9.00(d)

Table of Contents

who this book is for;
what to expect from this book;
how best to use this book;
Chapter 1: LEGO and robots: a great combination;
1.2 the NXT online community;
1.4 art and engineering;
1.5 qualities of a good program;
1.6 software, firmware, and hardware;
1.7 NXT-G;
1.8 what you’ll learn from this book;
1.9 what’s next?;
Chapter 2: the NXT-G programming environment;
2.1 a tour through the MINDSTORMS environment;
2.2 writing an NXT-G program;
2.3 your first program;
2.4 running your program;
2.5 your second program;
2.6 debugging;
2.7 the edit-compile-test cycle;
2.9 the configuration panel;
2.10 conclusion;
Chapter 3: the test robot;
3.1 right-side motor;
3.2 left-side motor;
3.3 chassis;
3.4 caster wheel;
3.5 attach the caster wheel;
3.6 add the NXT;
3.7 touch sensor bumper;
3.8 attach the bumper to the chassis;
3.9 ultrasonic sensor;
3.10 sound sensor;
3.11 color sensor or light sensor;
3.12 attach the wires;
3.13 the final beam;
3.14 alternate placement for the color sensor;
3.15 alternate placement for the ultrasonic sensor;
3.16 conclusion;
Chapter 4: motion;
4.1 the NXT motor;
4.2 the move block;
4.3 there and back;
4.4 around the block;
4.5 the motor block;
4.6 brake, coast, and the reset motor block;
4.7 the reset motor block;
4.8 the record/play block;
4.9 the remote control tool;
4.10 conclusion;
Chapter 5: sensors;
5.1 using the sensors;
5.2 the touch sensor;
5.3 the BumperBot program;
5.4 the sound sensor;
5.5 BumperBot with sound;
5.6 the light and color sensors;
5.7 the RedOrBlue program;
5.8 the ultrasonic sensor;
5.9 door chime;
5.10 the rotation sensor;
5.11 the BumperBot2 program;
5.12 conclusion;
Chapter 6: program flow;
6.1 the sequence beam;
6.2 the switch block;
6.3 the loop block;
6.4 the keep alive block;
6.5 the stop block;
6.6 conclusion;
Chapter 7: the WallFollower program: navigating a maze;
7.1 pseudocode;
7.2 solving a maze;
7.3 program requirements;
7.4 assumptions;
7.5 initial design;
7.6 following a straight wall;
7.7 turning a corner;
7.8 going through an opening;
7.9 final test;
7.10 conclusion;
Chapter 8: data wires;
8.1 what is a data wire?;
8.2 the GentleStop program;
8.3 tips for drawing data wires;
8.4 the SoundMachine program;
8.5 understanding data types;
8.6 using the number to text block;
8.7 displaying the tone frequency;
8.8 using the text block;
8.9 adding labels to the displayed values;
8.10 dealing with broken wires;
8.11 conclusion;
Chapter 9: data wires and the switch block;
9.1 the switch block’s value option;
9.2 rewriting the GentleStop program;
9.3 advantages of using a sensor block;
9.4 passing data into a switch block;
9.5 passing data out of a switch block;
9.6 matching more than two values;
9.7 using numbers with the NXT-G 2.0 switch block;
9.8 fixing the SoundMachine program’s volume display;
9.9 conclusion;
Chapter 10: data wires and the loop block;
10.1 the loop count;
10.2 timers;
10.3 the timer block;
10.4 a programmable timer, version 1;
10.5 the compare block;
10.6 a programmable timer, version 2;
10.7 a programmable timer, version 3;
10.8 conclusion;
Chapter 11: variables;
11.1 a place for your data;
11.2 managing variables;
11.3 the variable block;
11.4 the RedOrBlueCount program;
11.5 grouping common settings;
11.6 replacing long data wires with variables;
11.7 the LightPointer program;
11.8 constants;
11.9 conclusion;
Chapter 12: the NXT buttons and the display block;
12.1 the NXT buttons;
12.2 the NXT button block;
12.3 the PowerSetting program;
12.4 the display block;
12.5 the NXTSketch program;
12.6 conclusion;
Chapter 13: my blocks;
13.1 building bigger blocks;
13.2 creating a my block;
13.3 the custom palette;
13.4 editing a my block;
13.5 configuring a my block;
13.6 changing the name of a configuration item;
13.7 the DisplayNumber block;
13.8 using the DisplayNumber block;
13.9 managing the custom palette;
13.10 sharing programs with my blocks;
13.11 advanced my block topics;
13.12 conclusion;
Chapter 14: math and logic;
14.1 computer math;
14.2 integer math;
14.3 floating-point math;
14.4 the random block;
14.5 adding a random turn to BumperBot;
14.6 the logic block;
14.7 adding some logic to BumperBot;
14.8 the range block;
14.9 improving RedOrBlue;
14.10 improving RedOrBlueColorMode;
14.11 conclusion;
Chapter 15: files;
15.1 using files;
15.2 the file access block;
15.3 checking for errors;
15.4 the FileReader program;
15.5 restoring the RedOrBlueCount data;
15.6 managing memory;
15.7 common problems;
15.8 conclusion;
Chapter 16: data logging;
16.1 data collection and the NXT;
16.2 the VerifyLightPointer program;
16.3 controlling the amount of data;
16.4 data logging using the LEGO MINDSTORMS education NXT software 2.0;
16.5 conclusion;
Chapter 17: using multiple sequence beams;
17.1 multitasking;
17.2 adding a second sequence beam;
17.3 avoiding a busy loop;
17.4 adding a sequence beam to a loop block;
17.5 understanding program flow rules;
17.6 synchronizing two sequence beams;
17.7 keeping out of trouble;
17.8 conclusion;
Chapter 18: the LineFollower program;
18.1 following a line;
18.2 the starting point;
18.3 selecting the sensor trigger values;
18.4 improving the control algorithm;
18.5 conclusion;
NXT websites;
moving from NXT-G 1.0/1.1 to NXT-G 2.0;
block changes;
using old programs;
side-by-side installation;

Customer Reviews

Most Helpful Customer Reviews

See All Customer Reviews

The Art of LEGO MINDSTORMS NXT-G Programming 4 out of 5 based on 0 ratings. 2 reviews.
LizGriffin More than 1 year ago
OK, so I am a bit biased. My husband wrote the book. But here is the story. I am a middle school math and science teacher. I got a grant to buy some Lego Mindstorm kits. Who could pass up such a deal? I knew the kids would love them. I knew the students could follow the directions to build the robots but what then. I knew nothing about programming the robots. Luckily I am married to a great software engineer who is also a great teacher. Terry helped me through that first year of teaching robotics to middle schoolers. He was concerned, however, that there really was no resource out there for teachers like me who wanted to use the robots as a tool to teach. So he wrote this book. He wrote it for me and for all the other teachers who want to inspire students beyond a textbook. It is written in a clear, well organized, step by step manner. You don't need any programming background to be able to develop great programs that will challenge your students. And you will be able to answer all their questions.
Anonymous More than 1 year ago