Here is what to do if this does not result in the robot following the line at all:
- First, verify that you can still run the previous test code; if not, follow the troubleshooting there and come back when that works.
- Check for errors: Check that your file is like this code, that there are no syntax mistakes, and that you have typed the same names for things. Libraries should be present from the previous tests.
- Maybe the robot drives straight over the line, jitters, drives for a while following the line, then gets stuck somewhere, or misses a turn. This is where lots of fiddling and fine tuning comes in:
- Check that you have not swapped the left and right sensor connections.
- Reduce the speed.
- The line may need to be thicker. ...