Users Manual

CLASS 3
156
Modular coding for dancing robots
Let's divide the entire script we created earlier into three scripts. First, let's create a script that runs when the flag
icon is clicked. You can substitute the 'broadcast and wait' block instead of the LED and motor. Please see below.
Do you understand this script?
Set the servo motor to 90 degrees at first. Then, in the 'Infinite Repeat' block, 'If the value of Analog 0 Sensor is
<50', put the block as before.
In this case, 'LED_Shift' and 'Motor_Move' scripts are executed if 'LED_Shift broadcast and wait' block and
'Motor_Move broadcast and wait' blocks are inserted into “If’ syntax.
Now let's create the script 'LED_Shift' and 'Motor_Move'.
Activity