Users Manual

CLASS 3
72
Coding the Ultrasonic Turtle
Coding the Ultrasonic Turtle
Remember when you coded the mini windmill to work according to the distance of the ultrasonic sensor? If the
LED sensor of the digital port 10 is off and the digital value of the digital port 10 is higher than that of the analog
value of 15 (if the value is larger) You can code it so that the LED sensor is on.
Does it look like the script above?
Since the ultrasonic turtle is turning on the LED sensor when the distance is far away, the LED sensor should be
off when the distance is close. The value of 'Analog 0 sensor' is smaller than '15', which means that the distance
between the ultrasonic sensor and the recognition board should be closer to '15'.
At this time, the LED sensor must be turned off, so the 'output off of digital 10' block is executed by
the condition. If not (if the wall is longer than the analog value of '15') then you have to turn on the
LED sensor using the 'digital 10th output on' block.