User Manual
25
Configuration
Remember the commands to adjust the servo to 90 degrees previously? Now, let’s talk about
the other two commands.
The second command front-wheel-test is used to test whether the front wheels can turn
flexibly after assembly. When you run this command, it will drive them to turn left and right.
Besides, there is an optional parameter [chn]. It will be used only when you change the PWM
channel of the servo. If you use the default channel 0 according to the wiring diagram, there
is no need to enter [chn].
pi@raspberrypi:~ $ picar front-wheel-test
DEBUG "front_wheels.py": Set debug off
DEBUG "front_wheels.py": Set wheel debug off
DEBUG "Servo.py": Set debug off
turn_left
turn_straight
turn_right
turn_straight
turn_left
turn_straight
turn_right
^Cturn_straight
You may find the direction of the front wheels is not facing exatly front when they are in the
straight status (they will return to the status anytime the front wheels program stops running). If
there is an obvious deviation from the middle line of the front chassis, remove the servo and
run servo-install again; if it is just a little deviation (like about 0~15 degrees), it can be
adjusted by software.
Get into the folder SunFounder_PiCar/picar:
cd /home/pi/SunFounder_PiCar/picar
ls
pi@raspberrypi:~ $ cd /home/pi/SunFounder_PiCar/picar
pi@raspberrypi:~/SunFounder_PiCar/picar $ ls
back_wheels.py filedb.py __init__.py SunFounder_PCA9685
config front_wheels.py PCF8591.py SunFounder_TB6612
pi@raspberrypi:~/SunFounder_PiCar/picar $
Open the config file under the folder with an editor. You can see a few parameters. Modify
the value of turning_offset (the first parameter) to adjust the front wheels. Its value is 0 by
default, and you can turn the wheels left by decreasing the value, or turn right by increasing
it. For example, if you want to make the front wheels turn right a bit, just modify it to a larger