EasyManua.ls Logo

SunFounder PiCar-4WD - Python Program Control

Default Icon
72 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
60
Python Program Control
Python Example Program
Python Example Program is in the examples folder.
cd /home/pi/picar-4wd/examples
You can run them by using Python3.
keyboard_control.py
After running the example, press「W」, 「A」, 「S」, 「D」, and you can get the car going ahead, back, left,
right. And the keys「4」and「6」can increase or decrease the power of the motor.
Run it by using the following command.
python3 keyboard_control.py
obstacle_avoidance.py
After running the example, the car goes ahead automatically.
It can also turn right to get around the obstacles if there is anything obstructive ahead.
python3 obstacle_avoidance.py

Related product manuals