DFRobot MBT0021-EN 매뉴얼 - 페이지 7
{카테고리_이름} DFRobot MBT0021-EN에 대한 매뉴얼을 온라인으로 검색하거나 PDF를 다운로드하세요. DFRobot MBT0021-EN 18 페이지.
Program Link:
https://makecode.microbit.org/_T89YbzEyeF2m
6-3 obstacle Avoidance Robot
The function realized by the following program is: Maqueen Plus detects whether there is an
obstacle in front of it during driving. If there is an obstacle about 30cm ahead, turn to avoid the
obstacle and continue driving.
In the program, the distance read by the ultrasonic is assigned to a variable, and then it is judged
that if the value of this variable is less than 30, the turning action is performed for one second.
After turning for one second, it will continue to detect whether the distance is less than 30cm. If
there are no obstacles 30cm ahead, the car will go straight ahead.
Program Link:
https://makecode.microbit.org/_AR3X7gP4cVim