Skip to main content
Module 2 · Line Tracking

Lesson 2-8 · Detecting Intersections — Knowledge ChecksAnswer key

Correct answers are marked and the explanation follows each question.

  1. Why test is_at_cross() with a straight drive before using it in the line follower?

    1. A.Because line following cannot be tested on a cross
    2. B.So that if the test fails, the only thing that can be wrong is the cross check — the following code is not even in the program yet✓
    3. C.Because set_effort() is faster than arcade()
    4. D.It makes no difference; either order is the same

    One new piece at a time. When the test program has only is_at_cross() and a straight drive, a failure points at exactly one place. Put it inside the follower first and a problem could be in either.

  2. What makes track_to_intersection() stop?

    1. A.A fixed number of loop passes
    2. B.is_at_cross() becoming True — both sensors see the cross✓
    3. C.The error reaching exactly zero
    4. D.A timer

    The while condition is not is_at_cross(). The moment both sensors see the tape of a cross, the loop ends and the robot stops — however long that took.

  3. In track_to_intersection(), where is the intersection detected?

    1. A.In an if/else inside the loop body
    2. B.In the while condition — the body only steers✓
    3. C.After the loop, by checking the last error
    4. D.In arcade()

    The loop condition asks is_at_cross() every pass. The body never mentions the cross: it reads, computes, steers. Each part has one job, which is what makes each one testable.

  4. Why does track_to_intersection() end by driving 8.75 cm rather than driving for half a second?

    1. A.straight() is easier to spell
    2. B.A distance is the same with a full or flat battery and on any floor; a time would have to be re-tuned constantly✓
    3. C.time.sleep() cannot be used with motors
    4. D.Because 8.75 is a magic number

    The course avoids timing-based movement everywhere. Distances and sensor readings describe the world; a duration describes a guess about the motors.