Further reading
The following should help you look further into line following:
- Read about an alternative approach for line processing in the Go language on the Raspberry Pi from Pi Wars legend Brian Starkey at https://blog.usedbytes.com/2019/02/autonomous-challenge-blast-off/.
- Here is another line-following robot, using an approach like ours but more sophisticated: https://www.raspberrypi.org/blog/an-image-processing-robot-for-robocup-junior/.