Drum Hero

Overview

Drum Hero is a game inspired by Guitar Hero. The game utilizes a uVGAII chip by 4D Systems to display the game on a computer monitor. Using a speaker, SD card/reader and class D amplifier a song is played. On the screen there are three columns from which circles come down according to the beat of the song. The player needs to hit the piezoelectric sensors as the circles reach the bottom of the column. The sensors are connected to the LPC1768 microcontroller using the analog input pin. The user gets points according to the hits recorded.

The group members are:

  • Can Kabuloğlu, developed the code for the game,
  • Varun Duggal, implemented the speakers and piezoelectric sensors,
  • Yusuf Ziya Kuriş, tested the piezoelectric sensors and created the notebook page,
  • Lotanna Okoli, tested the game code and prepared the presentation.

/media/uploads/ykuris3/20170428_183709.jpg

The game code is written in C++ and tested on mbed's compiler. The code is shared below and has three main sections. It will be compiled into 2 mbeds since using all functions on one mbed slows it down. The first mbed has the code that updates the screen to show the circle movements and point changes. It also controls the piezoelectric sensor input, so when it is hit the code can check if the circle is cleared. The second mbed plays the song by reading a wav file from the SD card reader.

Demonstration

Parts List

  • 2 mbed LPC 1768
  • uVGAii chip [1]
  • Class D Audio Amplifier and Speaker [2]
  • SD Card Reader [3]
  • 3 piezoelectric sensors [4]
  • 1 pushbutton [5]
  • Audio Jack [7]

Block Diagram

/media/uploads/ykuris3/schematicdh.png

First mbed Connections

  • Pin 22 is connected to pin 22 of the second mbed. This pin sends a signal to start the music.
  • Pin 21 is connected to a pull-up pushbutton. This starts the game.

Connections for the Piezoelectric Sensor

  • Pins 18, 19 and 20 of mbed are connected to the red cables of the piezoelectric sensors. These are the drum sensors.
  • 1M Ohm resistor is connected across each sensor. Black cables are grounded.

/media/uploads/ykuris3/piezo.png

Connections for the uVGAII chip

/media/uploads/ykuris3/uvgaii.png

Second mbed Connections

  • Pin 22 is connected to pin 22 of the first mbed. This pin receives a signal to start the music.

Connections for the SD Card

/media/uploads/ykuris3/sdcard.png

Connections for the Speaker and Class D amplifier

/media/uploads/ykuris3/classd.png

Connections for the Jack Breakout

/media/uploads/ykuris3/sleeve.png

  • Pins SLEEVE and RING2 are connected to OUT+ of the class D amplifier.
  • Pin TIP is connected to OUT- of the class D amplifier.

Code

The game code follows an object-oriented design and implement the notes and the songs as objects. This approach would allow anyone to come and add any songs and the notes/beats regarding to that song easily. The code itself can be found below, simply put the 'drumHero' file on the first mbed and the 'drumHeroMusic' file into the second one, reset the both mbed's at the same time and follow the directions that come up on the screen.

The beats in the song are extracted using the matlab library given in the Libraries Used section (number 8).

This program is developed by Can Kabuloğlu and Lotanna Okoli.

Import programdrumHero

Code for the first mbed for the drum hero project

Import programdrumHeroMusic

mbed2

Libraries Used


Please log in to post comments.