This block starts automatic PID-based line following and continues until the robot detects the specified number of checkpoints.
How It Works
The robot repeatedly performs the following operations:
- Reads the five IR sensor values.
- Determines the position of the detected line.
- Calculates the line-position error.
- Applies the configured PID constants.
- Adjusts the left and right motor speeds.
- Checks whether a checkpoint has been detected.
When the line reaches an extreme position detected by an outer sensor, the robot can use the configured sharp-turn speeds to make a stronger correction.
Once the specified checkpoint count is reached, the robot stops the line-following operation.
Python Function – Quarky and Quarky Intellio:
lf5ir.followlinepiduntilcheckpoint(1)
Example: Set the checkpoint count to 1. The robot follows the line using PID control and stops when the first checkpoint is detected and confirmed.













