Manual

37
VII. Project
1 Obstacle Avoidance example
This is an example program of obstacle avoidance,
program according to the picture, then download it
into micro:bit.
When the sloth:bit goes forward and detect obstacles
in front, then the robot turn left for two times; after
turning, if no obstacles in front, the robot will goes
forward, and if there has obstacles, the robot will turn
left. Obstacle avoidance is realized by infrared, thus if
the size of the obstacle is too small or surface is
irregular, it may cause the obstacle undetected.