User Manual

39
The light follower includes three phototransistors, thus its status list is composed of three
elements which represent 8 statuses (based on permutation and combination). And here we
need to set related responses to these statuses.
The three elements show the status of the three probes: 1 represents light detected, and 0, for
none. For example, [1,0,0] shows that light is detected only by the left probe, meaning th
light source is at the left of the car, thus setting the car’s response action as turning left; [1,1,0]
means that light is detected on the left and central probes, thus its response action should be
set turning left too; and set it as turning right the same way according to the corresponding
status. When there is no light detected, the status is [0,0,0], so we set the response action to
stop and return to the standby mode.
Here, we need to set another variable the steering angle to distinguish between the large-
Run light following
subfunction
Read the
probe's status
[0,1,0]or[1,1,1]
move
straight
forwards
turn left turn right
[1,0,0]or[1,1,0] [0,0,1]or[0,1,1]
move
backwards
stop temporarily
and return to
standby mode
[1,0,1] [0,0,0]
Small turning
[1,1,0]
Large turning
[0,0,1]
Straight forward
[0,1,0]