Users Manual

SCRATCH CODING KIT
Now let's create a script when we receive the 'Open_Door' broadcast. The role of the 'Open_Door receiving' script
is to open the door and play the sound sensor for 2 seconds. Let's make it
Create a script like the one above. First, open the door by activating the angle of motor 8 (servomotor) by the value
stored in 'Open' variable. After that, turn on Digital 11. (Turn on the sound sensor.) Turn off Digital 11 output after
playing for 2 seconds. (Turn off the sound sensor). And we store 'open' in the 'door' variable. The 'door' variable
is a variable that tells you the current state of the statement.
Let ‘s try to organize the process so far again. First, delete all items in the 'Code' and 'Key' lists and save the
password '1234' in the 'key' list. Then, set the angle when the door is opened and closed. If the door is open,
the LED is on. If the door is closed, the LED will flash every 1 second. The first state starts with the door open. The
servomotor operates at a preset angle to open the door, and the sound sensor is played.
We created a script for the door when it opened. So, the script when the door is closed is very similar,
right? On the next page, you can create a script when the door is closed.
Tori Secret Safe ‘Open_door’ coding
Activity