A simple LEGO NXT robot that uses the light sensor to follow a black line. The program is pretty simple:
Go forward infinitely at 50% power
Until the light sensor reads greater than 50%
Then stop the left wheel
And move the right wheel forward 10 degrees
Repeat
This program makes the robot inch forward until it's moved off the black line. Then it moves to the left by 10 degrees and inches forward again. It assumes the line is a circle, and that the robot is positioned inside the circle, so it will traverse the circle in a counter-clockwise rotation.
No comments:
Post a Comment