Below are the program sketch how to code a line following robots using Arduino, to detect Black Line & White Line when digital signal is HIGH, sensor will read black line and when digital signal is LOW, sensor will read white line.
The Sketch Code
[crayon-67ca0cb7ed2d8841328464/]
Coding a Line Finder with Arduino Module Sensors for Robotics