Infrared Line tracking module
Run program
Enter the following command in the terminal to test line tracking module.
If the terminal displays the directory as below (where test.py is located), you can directly execute the test.py
command.
1. If not, execute the cd command:
cd ~/Freenove_4WD_Smart_Car_Kit_for_Raspberry_Pi/Code/Server
2. Execute test.py command:
sudo python test.py Infrared
Result:
When the black line is on the left side of the module, the left LED will light up and the terminal will print “Left”;
When the black line is in the middle of the module, the middle LED will light up and the terminal will print
“Middle”.
When the black line is on the right side of the module, right The LED will light up, the terminal will print “Right”,
You can press “Ctrl + C” to end the program.
If there are issues with the test, the infrared device may need to be adjusted. The adjustment screw is on top
of the sensor.