Last updated: December 30, 2018
NXT-G Programming: Program Your LEGOs to Do Cool Stuff?
NXT-G is a graphical computer programming language specifically designed to program the LEGO MINDSTORMS NXT robotics kit. Based on LabVIEW, NXT-G features a drag-and-drop development environment with graphical function blocks and “sequence beams” for connecting functions and directing the flow of a program.
NXT-G is designed for programs to be written in a fully-graphical environment, without requiring a single line of code. That, plus the inclusion of LEGO robots, makes NXT-G a popular language to introduce children and students to computer programming and robotics.
Though designed specifically for LEGO creations, NXT-G is capable of programming real-world applications and managing non-LEGO-branded sensors and components.
The LEGO MINDSTORMS NXT programmable robot kit was first released in 2006, replacing LEGO’s Robotics Invention System. The NXT kit included a complete robotics set, as well as the NXT-G programming software.
The core of the NXT kit is the NXT Intelligent Brick, the computer that controls all of your robotic creations. The brick is capable to taking input from up to four sensors and managing up to three motors. The original kit also included two motors, two touch sensors, and a light sensor. In 2009, LEGO MINDSTORMS NXT 2.0 introduced color and distance sensors.
The launch of LEGO MINDSTORM NXT also marked the introduction of the NXT-G programming language. While simple programming for an NXT invention can be done using the control pad on the Intelligent Brick, for more complex programs, users need to use either the NXT-G programming environment that comes bundled with the kit, or purchase a third-party programming environment that interacts with the Brick, of which there are many, including LabVIEW.
In 2013, LEGO released a new version of their robotics platform, EV3. The software provided with this set is an evolution on the previous NXT-G programming language. As such, it keeps much of the same functionality, but also adds several new features. Most notably, since the EV3 platform runs Linux, it has access to several new types of ports, including a USB connector and Micro SD slot — which can be used to load alternative operating systems. While the new blocks are mostly backward compatible, plugins are required to use them with the older NXT software, and some features will be unavailable. NXT blocks can be used with EV3 software, but they will not be able to take full advantage of the newer software features.
Since LEGO MINDSTORMS NXT was designed specifically for kids and schools, there are plenty of free resources and online tutorials available, because teachers love to share. Whether you’re looking for some pre-tested lesson plans or easy-to-follow guides to help teach your kids about programming, these sites should be very useful:
- STEMcentric: this site is designed to promote and provide resources for STEM education, so their tutorial was created specifically for use in schools. It’s a particular favorite, because all the lessons are short videos, making it ideal for classroom use and self-paced learning. As a bonus, all of the videos can be downloaded for offline use if you’re going to be teaching somewhere without a high-speed Internet connection.
- Generation Robots: this site covers everything you need to know to get started with NXT-G, including what system requirements you need to meet in order to install their software, how to work in the development environment, what programming blocks are available, how to connect them, and how to create your very first program.
- Dr Graeme: these tutorials are broken down into 2-hour sessions, intended to be used in schools. Each lesson begins with a challenge, presenting a design or problem for students to solve, and then provides the programming steps to solve the problem. Some lessons are web or text-based, while others include video.
There are several book available on programming with NXT-G, though most of them cover the same material, because the majority of NXT-G books are designed for young, beginning programmers. Of course, before you run out and purchase one of these books, you’ll probably want to pick up a LEGO MINDSTORMS NXT set first, because the book will be useless without it.
- The Art of LEGO MINDSTORMS NXT-G Programming by Terry Griffin: written for kids, parents, and teachers, this book takes readers through every aspect of programming with NXT-G, including core language concepts, preferred programming practices, and debugging strategies. Early on, the book guides readers to build their own test robot, which they will use throughout to run the complex programs they create.
- The LEGO MINDSTORMS NXT 2.0 Discovery Book: A Beginner’s Guide to Building and Programming Robots by Laurens Valk: this is another beginner’s guide to programming and robot creation with the NXT 2.0 set. It includes several interactive tutorials, instructions for building eight robots, 50 sample programs, and over 70 challenges to push readers to develop their own code.
- The LEGO MINDSTORMS NXT Idea Book: Design, Invent, and Build by Martijn Boogaarts, et al: written by the team behind the NXT STEP blog, including one of the original organizers of LEGO World, this book again covers the basics of NXT development, but quickly delves into more advanced concepts of NXT-G programming and robot design. Students will learn to design a wide variety of robots, including a robot that plays Rock Paper Scissors, a slot machine, scanners, and even vehicles.
- Advanced NXT: The Da Vinci Inventions Book (Technology in Action) by Matthias Paul Scholz: this is one of the few NXT books written for advanced programmers. It covers a variety of NXT programming environments and teaches programmers advanced NXT development though creating robotic versions of many of Leonardo da Vinci’s inventions.
Whether you’re a teacher looking to build your students’ essential programming skills, a parent hoping to inspire your kids, or a young, aspiring programmer, the LEGO MINDSTORM NXT kits are a perfect, hands-on introduction to programming and robotics. The concepts children develop through programming with NXT-G will apply to any language they pick up in the future, whether they stick with another graphical language such as LabVIEW or Pure Data, or transition to a more traditional text-based language.
Designing with NXT-G also allows kids to explore the many applications of programming, beyond simply manipulating images on a computer screen. Through the creation of several types of robots, they will develop real-world, physical devices, while deepening their understanding of programming, robotics, and engineering.