Hint 1 — Think about it
The sensor reads a brightness number: white floor is high, black tape is low. The edge of the line is in between — the average. If the reading is above that, you are drifting onto white: steer one way. Below it: steer the other way. The further away, the harder you steer. The turret stays centred.
Hint 2 — Which blocks to use
| color sensor F reflected light % | The brightness number: your steering input. |
| repeat until < color sensor sees green > | Keeps following until the finish. |
| motor ( D ) go to position ( number ) | Steering = (reading − target) × K. |
| start moving forward (slow speed) | Slow is more accurate. Start at 25 %. |
Hint 3 — Plan in plain words
- Measure the white floor and the black tape reflection; target = the average.
- Start moving slowly.
- Loop until green: steering = (reading − target) × K.
- Stop and celebrate.
Watch out: If the car steers away from the line, flip the sign of K. If it wobbles, make K smaller or the speed lower. The edge of the tape can flicker as “green” — ask for green twice in a row. Rear-steering cars need gentle curves.
Playbook: Follow the line · Green means go