Users Manual
SCRATCH CODING KIT
TORI Piano activation coding
If the infrared sensor connected to Digital Port 3 is pressed for more than 2 seconds, it must record, and if you
release your finger 2 seconds before, it must send a signal to play. For this, we need to use the ‘broadcast’ block.
‘Broadcast’ in the scratch means sending signals. If you send signal, you must be able to receive the signal, right?
The picture above is the script after the ‘broadcast’ block is added. If you press Digital 3 sensor for 2 seconds or
longer, all the contents stored in the list are deleted, and the Broadcast (Record)' block is executed and the timer
is reset. Otherwise (if you do not press for more than 2 seconds) the 'Broadcast (Play)' block is executed.
If ‘Record’ or “Play’ is broadcasted, we need to receive the signal. The picture above is the “receive (Record)” and
“receive (Play)” blocks. And below that is the script that will be activated. In other words, according to the time
that digital 3 sensor is pressed, it broadcasts 'Record' or 'Play', and the subsequent script is executed depending
on which broadcast was received.
TORI Piano coding activity