R
O B O
S u b p r o g r a m o b s t a c l e :
N o S i t u a t i o n
4
Obstacle directly in front of robot
5
Obstacle to the right of robot
6
Obstacle to the left of robot
Now you simply have to reproduce these conclusions in ROBO Pro using program elements.
Subprogram light:
PR=phototransistor right
PL=phototransistor left
As before, place the elements for querying
the phototransistors into the main program,
so you can see right away what is queried in the
subprogram.
The variable storing the value from the command elements
is also placed into the main program. It is used by several
subprograms. You connect it to the subprogram using a data
output.
Create the subprogram "Obstacle" according to the same principles as the subprogram "Light".
In the subprogram "Driving" you query the current
value of the variables using branch elements
and program the appropriate reaction:
SB=sensor behind
M
S
O B I L E
E T
State of the Sensors
I3=1; I4=1
I3=1
I4=1
A
B
C T I V I T Y
O O K L E T
R e a c t i o n
evade 90°
evade
to the left
evade
to the right
GB+USA
4 4
7 7
4 4
7 7