Dodger Game with LSM9DS1 and uLCD-144-G2

by Stephen Schwahn and Yash-yee Logan

Introduction

This 128 X 128 LCD Display Dodger Game has "evil invaders" coming from all corners of the screen and the user must avoid them at all costs. The player can be moved in all 2D directions to dodge invaders using the changes in accelerometer readings of the IMU LSM9DS1. If the player collides with an invader the game ends. This project gives the designer practice using reasonably complex color graphics and interfacing external input/output devices to holistically create a working embedded system.

In this version of the Dodger game, the LCD panel will show you invaders (red squares) randomly coming from any side of the screen.There is also background music that sets the theme of the game. Press the pushbutton to begin the game. The player (green circle) must use the controller (LSM9DS1) to move away from the invaders. If the player collides with the invader the speaker plays a crashing sound and the game ends. To play again you will need to reset the mbed.

The following hardware is required:

Hardware

  • 9DOF IMU Breakout - LSM9DS1
  • uLCD-144-G2 128 by 128 Smart Color LCD
  • ARM mbed Microcontroller
  • Class D Audio Amplifier Breakout - TPA2005D1
  • Small 8 ohm Speaker
  • SD Card File System
  • 2 4.7kohm resistors
  • Pushbutton
  • USB card reader
  • 2 SD cards

Hookup Guide

IMUSD ReaderAmplifierSpeakeruLCD CableExternal SupplyPushbuttonmBed
SCLp10
SDAp9
VDDVOUT
GNDGND
CSp8
DIp5
VCCVOUT
SCKp7
GNDGND
DOp6
PWR -,IN -GND
PWR ++5GND
IN +p18
OUT ++
OUT --
5vVU
GNDGND
TXp28
RXp27
RESETp30
+VOUT
-GND

Video

Code/Libraries

Import programDodger

A game for Lab 4 of ECE 4180


Please log in to post comments.