You are on page 1of 4

start

including the libraries


Initializing the variables and constants
setting the pins
Initializing the serial communication

Motors stopped

Initializing the pins

Servo 0 degrees

Read distance

A
DF = distance
DE = distance

Servo to 180
degrees
Servo to 90
degrees

DD = distance
Read distance

Servo to 90
degrees

B
S

N
If DF < DE

If DF < DD

If DE = DD

Half turn

Turn to left

If DE > DD

Turn to right

Go forward

Read distance

N
If DF < 20 cm

S
1

You might also like