Skip to main content
Module 2 · Line Tracking

Lesson 2-1 · The Reflectance Sensor — Knowledge ChecksAnswer key

Correct answers are marked and the explanation follows each question.

  1. Your sensor reads 0.8. What is it most likely over?

    1. A.A white surface
    2. B.A black line✓
    3. C.The edge of the line
    4. D.Nothing — that value is impossible

    High values (near 1.0) mean little light came back — a dark surface absorbs it. White gives low values near 0.0.

  2. test_sensors() prints Left: None Right: None every time, even while you slide the robot across the tape. What is the most likely cause?

    1. A.The reflectance sensor is unplugged
    2. B.get_left() and get_right() read the sensor but never return the reading✓
    3. C.The robot is not over the tape
    4. D.print() cannot show sensor readings

    A function that ends without a return statement gives back None. The sensor was read inside the function, but the value never came out of it. Put return in front of the read.

  3. Your 'off line' (white) values average 0.2 and your 'on line' (black) values average 0.8. What threshold should you choose?

    1. A.0.2
    2. B.0.5✓
    3. C.0.8
    4. D.1.0

    Halfway between 0.2 and 0.8 is 0.5. A reading above it means the line; below it means white.

  4. Why does the XRP have two reflectance sensors instead of one?

    1. A.As a spare in case one breaks
    2. B.So it can tell which side of the line it is on✓
    3. C.To read the line twice as fast
    4. D.One reads white, the other reads black

    Two independent readings let the robot tell whether it's drifting left or right of the line — essential for following it later.