Mission 8 Door Sensor

circuit playground express

Here’s your challenge: to count the number of times the door was opened.

On button A pressed 

 Show doorOpened in LEDs



On Pin P1 released

 Show red lights

 Play a melody

 Change doorOpened by 1

 Show doorOpened in a graph

Here’s my solution. I’m not sure you need the button A click, what do you think?

micro:bit

Here’s the algorithm I gave you to count how many times the door was opened

On button A pressed 
 Show doorOpened

On Pin P1 released
 Show an X
 Play a melody
 Change doorOpened by 1
 Show doorOpened

raspberry pi