3. Place the car at the location to be detected.
4. Click the "SCAN" pattern, PiCarPro will start to rotate and detect the surrounding
environment. After the detection is completed, there will be red dots in the pattern
where there are obstacles.
12.4.2 Main code program
For the complete code, please refer to the file
functions.py
.
Import dependencies and initialize.
1. import time
2. import RPi.GPIO as GPIO
3. import Adafruit_PCA9685
4.
5. # Ultrasonic module pins
6. UPin1 = 11
7. Upin2 = 8
8.