Mbed DuckHunt

Overview

For this project, we created a game similar to Duck Hunt using the mbed, IMU sensor, uLCD display, and speaker module. The point of this game is to shoot ducks with a gun aimer, which is controlled by a small breadboard module containing an IMU sensor and a push button. The IMU sensors controls the movement of the aimer while the push button is used to shoot. The speaker module provides a gunshot sound every time the player presses the push button. A scoreboard is at the top of the uLCD which keeps track of how many ducks the player has shot. The duck moves in a straight line and bounces off walls. It also changes speed every time it hits a wall.

Video Demo

Images

Complete setup

Mbed Board

Controller used by the player

Components

Connections

LSM9DS1Mbed
GndGnd
VoutVDD
SDAp28
SCLp27
uLCDMbed
GndGnd
Vu+5V
Rxp10
TXp9
RESp30
Push ButtonMbed
GNDGND
+P21
MbedTPA2005D1Speaker
gndpwr - (gnd), in -
Vout (3.3V)pwr +
p26 (any PWM or D/A)in +
out ++
out --
SD Card ReaderMbed
CSP8
DIP5
VCCVout
SCKP7
GNDGND
DOP6

Code

Import programDuckHuntmbed

DuckHunt game using IMU sensor and uLCD display


Please log in to post comments.