Keyestudio Smart Little Turtle Robot V3 Manual page 174

Table of Contents

Advertisement

www.keyestudio.com
The specific logic of ultrasonic avoiding smart car is shown below:
measured distance
of front obstacle
set servo to90°
measured distance
Detection
of left obstacle(set
servo to 180°)
measured distance
of right obstacle
(set servo to 0°)
set the initial angle of servo to 90°
Setting
Dot matrix shows smile face pattern
Condition1
Status
Stop for 1000ms;set the angle of servo to 180°,
read a1,delay in 500ms;set the angle of servo to
0°,read a2,delay in 500ms
a<10
Condition 2
a1>a2
a(unit:cm)
a1(unit:cm)
a2(unit:cm)
Status
Set the angle of servo to 90°,
rotate to left for 400ms (set
174

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents