Users Manual

SCRATCH CODING KIT
If the ultrasonic sensor is smaller than the 'Detect_value_Ultrasonic' parameter, the ultrasonic sensor should
sample. However, if the ultrasonic sensor is not recognized and the infrared sensor is not recognized, there is no
obstacle, so the robot must keep moving forward. Let's create a script that satisfies these conditions first. Create
the script below!
You can put the above script in the conditional statement of the 'Monitor_process' script.
If the ultrasonic transmitter is less than 'Detect_value_Ultrasonic', it will broadcast 'check_Ultrasonic' which is a
script to save '1' to 'is_Detect_obstacle' variable and to sample using ultrasonic sensor.
Otherwise, that is, if no sensor is recognized, there is no obstacle, so the car must continue straight ahead.
Therefore, you have to turn the steering wheel in the forward direction and then operate the DC motor. So, let 's
make' Move_FF 'and let the car move forward. The 'Move_FF' script looks like this:
Now, let's create a 'check_Ultrasonic' script that allows the ultrasonic sensor to sample! The ultrasonic sensor
samples the left direction three times, averages it down, sets the filter value, and the average of the three sampling
times to the right, decides the filter value, and codes it to judge where the object is!
Commentary
Use ultrasonic sensor to judge after recognizing the situation