Mission 10 Cookie Jar Protector


circuit playground express

micro:bit

circuit playground express

This is going to be the most secure cookie jar in the world.

If the light level, sound level are triggers OR the jar is tilted left or right then the alarm will be triggered.

micro:bit

Let’s do it. Let’s create the most secure cookie jar ever!

I’m going to add the following tests

  • if the compass heading is less than 300 degrees
  • if the brightness is greater than 1
  • if the cookie jar is tilted left or right

Instead of one huge if statement I created lots of little ones and if any of the tests are true the variable Alarm will be set to true. And if Alarm is true then alarm goes off, you have 3 seconds to put the cookie down!