Users Manual

CLASS 4
116
If the infrared sensor connected to the right front is smaller than the reference value or if the infrared sensor
connected at the lower right is larger than the reference value, the car should operate in the backward direction
and the steering wheel in the left direction. Likewise, if the infrared sensor connected to the left front is smaller
than the reference value, or if the infrared sensor connected at the bottom left is larger than the reference value,
the car should operate in the backward direction and the steering wheel in the right direction.
First, there must be a condition that recognizes the situation when the situation recognition variable is '0'. Then
you have to decide which obstacle is detected by which infrared sensor. Please create the script below
The variable 'is_Detect_Obstacle' is a variable used to recognize obstacles. If the value of this variable is '0', it
recognizes the obstacle. If it is '1', it judges the situation and acts. At the end of the operation, we need to change
the value from '1' to '0' again. By repeating this process, you become aware of obstacles.
Therefore, when the right infrared sensor recognizes an obstacle, it is necessary to change the value of the variable
to '1' after performing the judgment operation. Likewise, if the left infrared sensor recognizes an obstacle, you
should change the value of the variable to '1' after performing the judgment action.
Here, the judgment operation is to operate in the opposite direction. When the left infrared sensor is recognized,
it should go to the right, and when the right infrared sensor is recognized, it should go to the left.
Use the IR sensor to judge after recognizing the situation
Commentary