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

conclusion

Writing a line-following program is a classic NXT exercise that can challenge you to use all your NXT-G skills. The LineFollowerConfig program and the accompanying changes to the LineFollower program from Chapter 6 demonstrate how to use a file to store a setting for a program. This lets you avoid hard-coding values, making the program more flexible. You can use this technique for any program where the sensor target values or other settings may need to be changed.

The LineFollower2 program uses a proportional control algorithm to improve the TriBot’s responsiveness to changes in the direction of the line. Using the Light Senor reading and a little math to determine how much the robot should turn allows the robot to both move quicker ...

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