Users Manual
CLASS 3
108
Coding the Tori Secret Safe (principle)
Introduction
There are a lot of behaviors to express in the Tori secret safe. Since the program is not simple, we need to make
sure the code is clean before doing the complicated coding. Let’s try to arrange these actions once on this page.
1. With the door open, enter the numbers from 1 to 4 as the password when the button sensor connected to
the analog input ports 0 ~ 3 is accessed. After inputting, press the infrared sensor connected to the analog
4 port to compare with the saved password. If the entered number matches the password, the door closes;
otherwise, the door does not close.
2. When the door is closed, the sound sensor is plugged into the digital 11 input port and the LED sensor
plugged into the digital 10 port blinks.
3. In the same way, when the door is closed, input the number matching the saved number with the sensor,
press the infrared sensor, compare with the password, and the door will open.
4. If the number you entered does not match the password, the sound sensor sounds a short two times.
5. If the entered number matches the password, the door opens and the sound sensor makes a sound. The LED
sensor is still on when the door is open.
Now, shall we start building our own secret safe?