Logo
  • Home
  • Equipment
  • Tutorials
  • Calendar
  • TPZ Staff Page
  • (Beta) Tech Ai Support
Fab Lab Website
Fab Lab Website

Step 3: Move mine sweeper using xCoord

So far we’ve been able to increase or decrease the xCoord variable using tilts and show the value using showNumber. Now let’s use the xCoord position to actually draw our mine sweeper and see where it is on the map!

In this step you’ll…

  • Turn LEDs on to show where your mine sweeper is
  • Refresh the screen to clear unused LEDs
  • Slow down the movement to make it easier to control

Turn on LEDs to show where our sweeper is

Clear LEDs when our sweeper moves away

Add a pause to slow down the movement

Next up…

You may notice that the mine sweeper “escapes” from the map. Why is does it disappear? In the next step we’ll prevent the mine sweeper from leaving the screen.

Step 4: Fencing in the sweeper
The Possible Zone