SunFounder PiCar-S
In the line following function, we set the turning angle of the servo in different levels according to the detection results
of the probes. If the line in front of the car is detected as a small curve, then the car will turn a small angle; if it is a big
one, the car will turn a large angle. Thus, here we set four angle-turning constants: a_step, b_step, c_step, and d_step.
When the car moves forward originally, the servo is in 90 degrees. To drive the car to turn left, the servo should be in
90+step degrees; to turn right, the servo should be in 90-step degrees.
There is a special case: if the car runs off the track, and all the probes cannot detect the black lines any more, then it
will continue the program below.
66
Chapter 1. About the PiCar-S
Содержание PiCar-S
Страница 1: ...SunFounder PiCar S www sunfounder com Nov 10 2021 ...
Страница 2: ......
Страница 4: ...ii ...
Страница 8: ...SunFounder PiCar S 4 Chapter 1 About the PiCar S ...
Страница 9: ...SunFounder PiCar S 1 1 3 Mechanical Fasteners 1 1 Components List 5 ...
Страница 10: ...SunFounder PiCar S 1 1 4 Wires 6 Chapter 1 About the PiCar S ...
Страница 11: ...SunFounder PiCar S 1 1 5 PCB 1 1 Components List 7 ...
Страница 12: ...SunFounder PiCar S 1 1 6 Other Components 8 Chapter 1 About the PiCar S ...
Страница 22: ...SunFounder PiCar S 18 Chapter 1 About the PiCar S ...
Страница 26: ...SunFounder PiCar S 22 Chapter 1 About the PiCar S ...
Страница 27: ...SunFounder PiCar S 1 4 Circuits Building 1 4 1 Connect the Power 1 4 Circuits Building 23 ...
Страница 28: ...SunFounder PiCar S 1 4 2 Connect the Modules 24 Chapter 1 About the PiCar S ...
Страница 29: ...SunFounder PiCar S 1 4 3 Connect the Servo 1 4 Circuits Building 25 ...
Страница 44: ...SunFounder PiCar S Mount the wheels onto the Upper Plate carefully 40 Chapter 1 About the PiCar S ...
Страница 69: ...SunFounder PiCar S Subflow of Line Following Function 1 8 Arming the Car 65 ...
Страница 74: ...SunFounder PiCar S 70 Chapter 1 About the PiCar S ...