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 10. Wait for It!

One of the most useful things your robots will be doing is waiting. Yep, you heard me right—waiting. Don't believe me? Okay, think about it this way:

  • SPOT is moving toward a red line, waiting for the Color sensor to detect the line.

  • SPOT is preparing to throw a ball at a target, waiting for the Touch sensor to be pressed and released.

  • SPOT is rolling towards the wall, waiting for the Ultrasonic sensor to detect the wall.

  • SPOT is sitting on the start line, waiting for me to push the Left button to let it race forward.

Are you beginning to see that waiting is an important part of a robot's program? Your robots will probably always be waiting for something to happen. It may be as simple as waiting for you to press the Enter button ...

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