Users Manual
CLASS 3
86
Ultrasonic Turtle ‘Do’
Now, let's create a script in earnest. Let's start by setting the standard for distance. Consider the first distance
reference as the analog value '10'. Just like I had the baseline when I turned on the LED sensor in the front.
Now, start coding '10', assuming that the value is incremented by '5' so that the interval is fixed. First, let's create
a script to play the Do when it is smaller than the analog value '10'. Create the script below!
The above script is a script that will play a scale of 60 beats per minute if the distance between the ultrasonic
sensor and the wall is less than '10'. The reason for using the 'if & else' syntax is that you have to play a different
note if you are farther away from the analog value of the turtle '10'.
Now we are going to create a script that will be nested so that the 'no' condition is followed by the 'if & else'
syntax for the next scale. Do you understand?
Below is a picture of how the distance depends on the distance. Please refer to future when deciding
standards!
10
do re mi pa sol la si do
15 20 25 30 35 40 45
“IF” syntax utilization