• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Social distancing? Try a better way to work remotely on your online files. Dokkio, a new product from PBworks, can help your team find, organize, and collaborate on your Drive, Gmail, Dropbox, Box, and Slack files. Sign up for free.


Charles Wang - Lab 6

Page history last edited by Akil Srinivasan 8 years, 9 months ago

Charles Wang

4 August 2011



Lab 6 – Barebones MP3 Player


Part B. Connect And Test Your Decoder

Describe the tone pattern you hear (ie, high or low?  how long? etc)

There are 3 pitches: high, middle and low. Each tone lasts about 2 seconds with a pause in between.  


Part C. Play Some Music!

Tell a member of the teaching team what your song is (or better yet, play it for us). If you don't know the name, just decipher some of the lyrics.

Mahna Mahna from the Muppets. 


Does this code play all the songs in all the directories of the SD card? If not, which songs does it play? How does it keep from playing the text file?

The code only plays songs from the root directory.  The code also checks the file name extensions and plays only files that end with “.wav” or “.mp3” 


Change the 'song' code to save the current volume setting in yourEEPROMand fetch and set that value during initialization.  Note that the first MAX_FILE_COUNT*MAX_NAME_LENGTH (in this case, 520) bytes of the EEPROM are used to store file names, so don't overwrite those. 

int volumeByte = 1000;


void setup()


  if(EEPROM.read(volumeByte) != mp3_vol)


    EEPROM.write(volumeByte, mp3_vol);




Part D. Pause to Learn About Interrupts

Draw us a quick sketch of what your circuit looks like.

My interrupt button circuit is the same as the one I’ve used in the labs before.

This is a sketch of circuit I’m using that I borrowed from lab 2. 

What are the pros and cons of using this method?The advantages are less computation, which frees your microcontroller to do more stuff. There is also less code to write. The con is that you can’t use the interrupt function with this method.  ✔ Exactly, it 'polls' instead of uses interrupts.  It actually uses more execution time, because of the polling in the main loop, but it is easier to write.


Now, take what you learned to make an interrupt driven pause function for your Barebones MP3 player!



Overall, good answers!  I couldn't find the video we asked for in the "In the Report" section of lab 6.


Comments (0)

You don't have permission to comment on this page.