Users Manual

SCRATCH CODING KIT
Create a script that stops when the line tracer follows the black line and then goes off. It is very easy to use the
timer I learned earlier.
If the line tracer leaves the line, the analog value will be lower for both infrared sensors. In other words, one is
that the analog value is big and one is not the analog value is small. In this case, if you use the timer and the
timer is waiting for 1 second, but the analog input of the infrared sensor is not correct, you have to stop all 2
motors.
Make a script below
If the timer is greater than one second, I will stop the motor 4 and the motor 7. That is, if the input values of two
infrared sensors do not come in conditionally, the time of the timer will continue to flow, and if the time exceeds
1 second (if the input value of the infrared sensor that does not meet the condition is kept over 1 second) It is.
If so, if the line tracer works normally along the black line, then the timer's time should not flow. This is because
the motor will stop when the time of the timer expires and it goes over a second. Therefore, if the line tracer is
working properly, you need to continue to initialize the timer. At this time, we use the "timer initialization" block.
Drag the "Timer initialization" block onto the Observation tab and double-click on it. You can now see that
the timer value on the stage is initialized to 0 seconds. Now we need to use the "Timer initialization" block in
the script that runs the existing line tracer so that the timer does not run out of time. Try putting blocks in your
previously created script.
Coding Line Tracer Timer
Commentary