4.1.1 Program functions and design ideas<br>1, when the microcontroller received the photoelectric switch and barrier-avoidance signal, control the motor left turn right turn, to achieve track.<br>2, the preparation of procedures so that the microcontroller drive ultrasonic detection module to detect the distance of the car in front of the car, adjust the speed of the rear car.<br>3, photo-switching program to achieve mutual communication between the two cars, to achieve overtaking, leading function.<br>4.1.2 Program design ideas<br>1, follow the track turn design ideas<br>When the left and right photoelectric switches are received to check the car signal, both photoelectric switches are output low level, car straight, when the left and right photoelectric switches are not received signal, receive signal, left and right photoelectric switch output high, low, car turn right, when the left and right photoelectric switches are received signal, can not receive the signal, left and right photoelectric switch output low, high level, car left.<br>When the turn mark is detected, the output is high, and the marking line count function is realized, as the starting, cornering and overtaking sign of the car, the start, turn and overtaking of the car is realized.
正在翻译中..