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

Get Lego Mindstorms NXT-G Programming Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.