Skip to Main Content
The Art of LEGO MINDSTORMS NXT-G Programming
book

The Art of LEGO MINDSTORMS NXT-G Programming

by Terry Griffin
August 2010
Intermediate to advanced content levelIntermediate to advanced
288 pages
13h 21m
English
No Starch Press
Content preview from The Art of LEGO MINDSTORMS NXT-G Programming

passing data into a switch block

To make the TriBot’s speed depend on its distance from the wall, the Distance value from the Ultrasonic Sensor needs to be connected to the Move block’s Power plug, just as in the original program. To make a data wire cross the boundary of the Switch block, you must first unselect the Switch block’s Flat view option (shown in Figure 9-7). Once the Switch block is using tabbed view, a data wire can be drawn between the Ultrasonic Sensor block’s Distance plug and the Motor block’s Power plug, as shown in Figure 9-8.

Unselecting the Flat view option

Figure 9-7. Unselecting the Flat view option

Figure 9-8. Connecting the Distance to the Power setting ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The Art of LEGO MINDSTORMS EV3 Programming (Full Color)

The Art of LEGO MINDSTORMS EV3 Programming (Full Color)

Terry Griffin

Publisher Resources

ISBN: 9781593272180Errata