Users Manual

SCRATCH CODING KIT
Coding the scorpion robot with an ‘if’ phrase
Since we controlled the servo motor and LED sensor with ‘if ..or else..’, we are now going to use two ‘if’ phrases to
control the servo motor and LED sensor. First, make a script that will lift the tongs up and turn the LED sensor on
when the brightness sensor value is big (when it’s covered).
The script above will lift the tongs up and turn on the LED sensor when the value of the brightness sensor is big.
Now, let’s see how the servo motor and the LED sensor will work when the value of the brightness sensor is small.
Make the script you see below.
Did you make the scipt? The script above sets the tongs down and turns off the LED sensor when the value of the
brightness sensor is small. Now, combine the two scripts, and it will look like the one below! Start the script and
try again slowly if it does not work well.
exercise