Hello, I managed to build the hardware part of a line following robot but with only 3 home-made IR sensors with IR led and phototransistors. Now I have come to the programming part and hit a question: is it better to use an Interrupt to detect when the line goes right or left ? Or should I use IF and WHILE statements?
My idea was to use the central IR sensor to detect when the robot was on the line. If the line goes left, it triggers the left sensor and the whole robot goes left until the center IR sensor detects the line again. Is this logic sound?