Mine Field Game with Thumb Joystick

Components used:

  • Thumb Joystick
  • SD Card
  • Speaker
  • uLCD

For this lab we have created a mine field game using thumb joystick to control movements of the player. Speaker, SD card, and uLCD was used for audio and visual effects.

Thumb Heading


VCCp 40 - Vout
VERTp 15
HORZp 16
SELnot connected
GNDp 1 - GND

VERT is used to control vertical direction and HORZ is used to control horizontal direction. VCC and GND connections are for power. SEL is not used in this demo.


Follow the link on how to setup a speaker. In our demo the speaker connected to pin 18.


SD Card

Follow the link to setup your SD card.



Follow the link to setup your screen.


Code for Mine Field

Import program4180_Lab4

Mine Field Game

Video Demo

As you can see in the video on the first try we purposely step on the mine to lose and "You lose!". Second time around we avoid all of the mines in three rounds. and after we win sound of applause is played by the speaker and "You won!" is appeared on the screen. The mines are seen on the screen but they can be disabled by commenting out "#define MINE" in the beginning of the main.cpp code;


#define MINE

Please log in to post comments.