the VerifyLightPointer program
The LightPointer program presented in Chapter 11 uses the Color Sensor or Light Sensor to point the TriBot toward a light source. The TriBot spins in a circle and remembers the position where it detected the brightest light level. After completing a full circle, the TriBot returns to the stored position, which should point it toward the light source.
The design of the LightPointer program depends on two assumptions:
The sensor can detect the brightest light level while the TriBot is spinning.
Pointing the TriBot at the brightest detected light level will point it at the light source.
If either assumption is wrong, the program won’t work. For example, the program could fail if the robot spins too fast to accurately read ...
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.