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

rewriting the GentleStop program

Recall that the GentleStop program makes the TriBot slow down and gently stop as it approaches a wall. The robot stops when the Power setting for the Move blocks is too low to make the robot move, but a better approach would be to stop the motors when the robot is close to the wall, instead of letting the motors stall. In this section, you’ll rewrite the GentleStop program to do just that, using the output from the Ultrasonic Sensor block as the trigger for a Switch block. The program will work like the original, but you’ll use a different approach to programming it.

You’ll write the program in two parts. In the first part, you’ll make the TriBot move forward and then stop when the reading from the Ultrasonic Sensor ...

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