counter challenges

Before we get started

Complete the following guided tutorial At the end of the tutorial, click keep editing. Your code should look like this:

Challenge 1

Let's add the code to count when B is pressed. Add an event handler with on button pressed(B) then add the code to count.

Challenge 3

Now let's try to reset the counter when the BBC micro:bit is shaken. You will need to register an event handler with on shake.