O'Reilly logo

The LEGO MINDSTORMS NXT 2.0 Discovery Book by Laurens Valk

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

11

using data blocks and using data wires with loops and switches

Now that you know how data wires work, you can do some really interesting things with more of the programming blocks. You can use some of these new blocks to make the NXT combine and process sensor values so that they can be used as input values for other actions. For example, with the tricks learned in this chapter, you’ll be able to program your robot to do something only when two sensors are triggered at the same time or to do things randomly, rather than performing a series of preprogrammed actions.

In this chapter I’ll show you how to do math on the NXT with the Math block so that you’ll be able to have your robots calculate, for example, the distance to travel based on a ...

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