constants
As you write more programs, you may find that you use some values repeatedly. A value that doesn’t change is called a constant. For example, the number of degrees needed to spin the TriBot in a full circle is a constant. The value doesn’t change, as long as you don’t change the way the robot is built. You can use this value in any program that spins the robot all the way around, and by adding a Math block, you can easily spin the TriBot halfway around, as in the ThereAndBack program from Chapter 4; or you can have the TriBot make a quarter turn, as in the WallFollower program from Chapter 7. Some other constants you might find useful ...
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.