Repeat until light sensor is less than 30.
Set motors to move forward.
If the light sensor sees dark (say < 40 -some adjustment may be required for ambient lighting if not using automatic setting) turn right.
If the light sensor sees bright ( say > 50) turn left.
Save this program as m5LineFollowing then download and test your program. Your Alpha Bot should follow a line.
Challenge: Calibrate your light sensors using the built-in calibrate program. Write another line follower program per the suggestions in Computer Programming 101 and test both to see which is faster and which is more accurate. Save, download and test your programs. How does turning on the built-in light affect your line follower programs? Experiment by adjusting the dead band settings both larger and smaller than the values viewed over white and dark by raising or lowering first one value then the other then raise and lower both. Which dead band gives the fastest time?
How can this program be modified so that your Alpha Bot follows the left side
of the line?
Write down your comments recording any problems and their solution or any pertinent details learned during execution of this mission.