the PowerSetting program

In Chapter 11, I mentioned that you could improve the WallFollower program by using a variable to store the Power setting used by the Move blocks. This would make changing the value easier because you would need to change it in only one place, instead of changing all seven Move blocks. What if you want to try several different values? This can still be a time-consuming process since you would need to change the Variable block and download the program for each value you want to test.

You can make testing different Power settings more convenient by using the buttons to select the Power setting before starting the main part of the program. In this section, I’ll describe the PowerSetting program to show you how to do this. ...

Get The Art of LEGO MINDSTORMS NXT-G Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.