Getting Started Guide
SCRATCH CODING KIT
Coding a Line Follower
Write down the program step by step. First, write down when the infrared sensor value is on the line. Use the
black line below.
First, we need the 'if' syntax to tell us what to do if the infrared sensor is on the line.
If the sensor value is high (if the infrared sensor is on line), the right motor will turn on and move the car to the
left and out the line! Be sure to check the direction of the motor counterclockwise or clockwise to see which value
causes your line follower to move to the left.
You can set the threshold value based on the values above the black line and above when you
are outside the black line. Should you choose between the values above the black line and
those outside the black line?
적외선 센서가 선 위에 있으면
값은…
적외선 센서가 선 밖에 있으면
값은…
The value when the infrared
sensor is on line
The value when the infrared
sensor is out of line
Coding Line Follower