Step 1: Tilt right along X axis

When searching for mines, we’ll need a way to move around and check each spot on the map. The Microbit can detect when we tilt up and down or side to side, and this is perfect for controlling where our mine sweeper goes.

In this step, we’ll…

  • Create a variable to track our sweeper’s x-coordinate
  • Play with increasing this variable when the micro:bit tilts right

Create a variable called xCoord

Make xCoord increase by 1 when the Microbit tilts right

Debug the tilt behavior using showNumber

Up next…

We can increase the xCoord by tilting right, now we need to decrease the xCoord by tilting left

Step 2: Tilt left along X axis