O'Reilly logo

Lego Mindstorms NXT-G Programming Guide, Second Edition by James Floyd Kelly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Record and Playback

One nice feature of the NXT-G programming language is the RECORD/PLAY block. With this block, you can record the movements of your bot's motors to a file that is stored on the Brick. This file can be used to later play back the bot's movement.

For this chapter, we'll use SPOT again. But this time, I'm going to add one additional motor (motor A) to make SPOT do something silly, like spin an arm or a sensor around. Feel free to do what you like. My SPOT has motor B (in Port B) spinning the left wheel of my robot and motor C (in Port C) spinning the right wheel. I have motor A (in Port A) spinning a small propeller (like an airplane) on the front of the robot (see Figure 5-1).

Figure 5-1. SPOT with his new propeller

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required