![SunFounder RollFlash Скачать руководство пользователя страница 41](http://html.mh-extra.com/html/sunfounder/rollflash/rollflash_user-manual_1396377041.webp)
39
5.2
Obstacle Avoidance
An ultrasonic module is installed on the robot, so it can detect obstacles ahead and
measure the distance, at last avoiding the obstacles in front.
1.
Open the code file
Avoidance.ino
under the path
Rollflash Bionic Robot Turtle for
Arduino/Code/ 3. Avoidance
and upload to the RollFlash.
2.
Construct a building for the robot to play. You can see it can avoid obstacles
independently. Or just put some barriers for it and observe whether it can bypass. It really
does you'll find. Interesting, isn’t it?
5.3
Line Following when Avoiding Obstacle
Under the RollFlash there is a 5-channel line following module, which enables the robot to
go following a black line. In addition, in the sketch
4. Following
, the part for obstacle
avoiding is also included. Therefore, after the sketch is run, the RollFlash can smartly avoid
the obstacle ahead when following a line. Let's check how to make it!
1.
Open
Following.ino
under
Rollflash Bionic Robot Turtle for Arduino/Code/ 4. Following
and upload it to the robot.
2.
DIY a map
.
Prepare a white board (or a flat light-color surface) and some black tape
or a black Marker (not permanent). Then draw some straight-line or curved shapes with
the pen or sticking the tape. Or, you can also do on a black surface like blackboard
with a white chalk. But, DO pay attention to the following
TIPS
:
a)
The lines should be at least 16mm wide.
b)
The semi-diameter of the curve should be no less than 100mm.
c)
Within 40mm on both sides of the line, there should NOT be anything almost black
(especially dark purple); otherwise, the IR sensor will be influenced when detecting.
d)
The edge of the STOP block should be perpendicular to the trunk; the block should be
50mm wide and 60mm long at least.
SunFounder
Содержание RollFlash
Страница 44: ...42 Control the servos on pin 5 pin 6 and pin 8 S u n F o u n d e r ...
Страница 52: ...50 S u n F o u n d e r ...