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-6741f8e82c324177201646/]
Coding a Line Finder with Arduino Module Sensors for Robotics