Follow a Line (Hint)

Home > Activities > Robots > Examples

Computer Challenge logo

 

  Equipment
  Building
  Programming
  Missions
Examples
  Contests
  Links
  Award

 

wait for touch diagram

Action: Follow a line using one light sensor. More precisely, follow an edge with dark on the left and light on the right. The edge may curve either way or go straight. Fill in your own code for (Turn left) and (Turn right).

Reading the program

  • Begin the program
  • Begin a loop (red land)
  • Read the light sensor connected to port 2
    If the value read is greater than 40:
    • (Turn left) - your code here
If the value read is less than or equal to 40:
    • (Turn right) - your code here
  • Merge
  • Loop to the red land (red jump)
  • End the program

Where to find it

Light Sensor Fork: click Structures wait for buttonthen Forks on the functions palette.

For more information: See the Follow a Line tutorial or Context Help in RoboLab.


  © 2012 Computer Challenge