Objective: In this activity, you will add a light sensor to your mobile robot and program it to detect black lines.

Design Specifications

• Your robot will begin in the middle of a white square surrounded by black lines. Write a program to move your robot forward until it senses a black line. At this point it should stop, back up, spin to a random direction, and move forward again.
• Advanced Programming: The robot must stop moving after 30 seconds.

What You Should Know

Light Sensor

Programming: Control Flow

Programming: Light Sensor

Programming: Timers

 

 

Helpful Hints

• Different lighting conditions could affect your light sensor reading.
• Make sure your light sensor is calibrated to the right values. Is there a way that this could be done when you start your program?

 

Back to Design Challenges