Ultrasonic module
Next, use jumper wires F/F to connect ultrasonic module with pins on smart car board.
When connecting the ultrasonic module, you need disconnect the Servo1 cable, so that the servo can
rotate freely, and after the wiring is completed, connect the servo cable again. When wiring, you should
keep the silk screen of the ultrasonic module and the smart car board consistent. Vcc should be connected
to 5V, Trig to TRIG, Echo to ECHO, and Gnd to GND.
If the connection is wrong, for example, if Vcc is connected to GND, and Gnd is connected to 5V, it will
cause the damage to ultrasonic module. After the wiring is completed, you can start testing.
Run program
Enter following command in the terminal:
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 Ultrasonic