Users Manual

SCRATCH CODING KIT
Modular coding for dancing robots
From now on, we will learn about modularization. You may feel that the script you learned earlier is somewhat
complicated to code. Modularization of these scripts (in smaller units) makes it easier to understand when coding.
First of all, let's divide the script into three and code it simply.
We need a 'make broadcast' block to split the script into three. In Scratch, 'broadcast' means to send a signal.
If you do a broadcast, you have to get a broadcast. On the scratch 'control' tab, drag the 'Broadcast and Wait'
blueprints.
Click on the black arrow in the 'Broadcast and Wait' block to bring up the window shown above. In the 'Name
of message' box, type the name of the script that will receive the signal. Make 'LED_Shift' that will handle the
operation of the LED sensor and 'Motor_Move', which will be responsible for the operation of the motor.
Did you make these two blocks? Now, on the 'Controls' tab, try pulling the 'when you receive’ block.
When 'LED_Shift' or 'Motor_Move' is broadcast, you have to receive the broadcast. The above picture is called
'When receiving LED_Shift' and 'When receiving Motor_Move'. And below that is the script that will be run after
that. In other words, depending on which broadcast you have received, subsequent scripts will be executed. So
we can create multiple scripts.
Activity
script script