Memory Card Matching Game

Project By:

Krish Ravindranath and Kristen Fernandez

Overview

For this lab we have made a memory card matching game using the the mbed LPC 1768. A navigation switch is used for player control, and a uLCD, speaker, SD Card, Audio Amp, and potentiometer are used for visual and audio effects.

How to Play

When the game is started, 16 cards are shown on the screen in the flipped down position. Using the joystick, the user can navigate to any of the 16 cards. When the user presses down on the joystick, this flips the selected card over into the face up position. This reveals a unique shape and color combination. This first card will remain visible until the user navigates to and selects a second card. If the two flipped cards are a match (same color and same shape), then the user earns a point and two cards will be removed from the board. Otherwise, they will briefly remain visible before returning to the flipped down position. To win, the user must find all 8 matching pairs in 60 seconds before the game is over. At the end of the game, the user’s score will appear on the screen. The locations and shapes are randomly generated at the start of each game, so the user can reset the mbed and enjoy a brand new game.

Components

  • SD Card File System: The memory required for audio files is too large for an mbed’s memory, so an SD card is used to store the files that are used for the sound effects. More information on this component can be found at: https://developer.mbed.org/cookbook/SD-Card-File-System

Wiring

mbeduLCD
VU+5V
p27TX
p28RX
p26RES
GNDGND
mbedNavigation Switch
GND-
p9U - up
p8C - center or fire
p7L - left
p6D -Down
p5R - right
mbedMircroSD Breakout
GNDGND
VoutVCC
p14CS
p11DI
p13SCK
p12DO
mbedTPA 2005d1 Audio AmpSpeaker10k Potentiometer
GNDPWR -, IN-
VoutPWR+
p18IN +
OUT ++
OUT --
VOL (3 pints)The three pot pins are connected adjacent to the three 3 VOL pins

Pictures

Overview

(Wiring of GND and Power of SD Card is done beneath the breakout) https://41.media.tumblr.com/e195bf5cfb9e62e80ab27d3fe7bf2481/tumblr_o41pv86rmL1qez5eno1_540.jpg

Game in play

https://40.media.tumblr.com/525f1aae7deb8ef7659042c35033099f/tumblr_o40bmeTClL1qez5eno1_540.png

Video

Code

Import programMemory_Card_Game

ECE 4180 Spring 2016 Lab 4


Please log in to post comments.