Sanga Park, Seiya Ono, Ryan Tsang, Jehan Yang
Setting up a lab computer:
cd ~/buckler/software
git clone https://github.com/onibrow/eecs149-proj
cd eecs149-proj
./setup_vm
Project Goal
We will implement a discrete note, single dimension rhythm game similar to Guitar Hero where the player is required to, on beat, actuate inputs from a pool of predefined discrete buttons. We will take this style of gameplay and translate into a Bop It driven hardware and LED display for the beat map.
Project Approach
The gameplay with be modeled as a state machine that keeps track of the state of the game (in game play, idling, song selection, etc). The sensor inputs will generate interrupts that trigger different events within the game. Timing and synchronicity will be very important to make sure the LEDs are lighting up on cue with the music. As a final product, we would like to seamlessly take input from the player and translate that to well timed gameplay with LED signals and music.
- Try to compile. What library is it missing? ex:
blah.h
- Does the file exist in the sdk? Find it by going to the sdk folder
~/buckler/software/nrf52x-base/sdk/nrf5_sdk_15.3.0
and runningfind . -name 'blah.*'
. Take note of the directory the header and C file are located in. - Edit
eecs149-proj/vm_setup/Includes.mk
. You will need to add 2 Lines:- Near line 180, the
SDK_HEADER_PATHS
should end and becomeSDK_SOURCE_PATHS
. Add a new line at the end of the header paths and add the directory you found in step 2 for the header file. You might want to check if that directory is being checked already. ex:SDK_HEADER_PATHS += $(SDK_ROOT)external/components/
- Near line 270, the
SDK_SOURCE_PATHS
should end and is followed byifdef SERIALIZATiON_MODE
. Add a new line at the end of the source paths and add the directory you found in step 2 for the C file. Similarly, you might want to check if that directory is already being sourced. ex:SDK_SOURCE_PATHS += $(SDK_ROOT)external/components/
- Near line 180, the
- Edit
eecs149-proj/vm_setup/Board.mk
. You will need to add 1 Line:- Near line 95, the list of
BOARD_SOURCES
should end. Add the C file at the end of the list (make sure to terminate with a\
). ex:blah.c\
- Near line 95, the list of
- Repeat the above steps for all dependencies.
Meeting MP3 files are compressed so they need to be decoded to be played on a DAC -> this isn't particularly ideal so we will switch over to WAV files which are uncompressed. From Audacity, we can see that we can save them in various formats (16 bit or 24 bit PCM), which will allow us to basically read in binary and shove them into either the I2S registers or over I2C. Here's a tutorial on how to play WAV files and goes over their limitations.
- I2S begins page 445
- Loopback example for sanity check
- nRF SDK I2S
- MCP4725 DAC Driver