Gilligan Matt Lab 6


Part B. Connect And Test Your Decoder

Describe the tone pattern you hear (i.e., high or low, how long, etc.).

It's a high pitched like beep boop booooooop.

 

Part C. Play Some Music!

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?

No - it plays all but the last song. The sd_dir_setup() function checks the name of the files to make sure they end in MP3 or WAV.

 

Change the Song (or Simple_MP3_V2) program to save the current volume setting in your EEPROM, then fetch and set that value during initialization. Note that the first max_num_songs * max_name_len (in this case, 520) bytes of the EEPROM are used to store file names, so don't overwrite those. 

Change the

#define mp3_vol 175

to

byte mp3_vol = 175;
void setup() {
     ...Mp3.begin...
     Mp3.volume(EEPROM.read(521));
     ...  
}  
  
void set_mp3_vol(byte new_mp3_vol) {
     mp3_vol = new_mp3_vol;
     Mp3.volume(mp3_vol);
     EEPROM.write(521, mp3_vol);

 

Part D. Pause to Learn About Interrupts

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

 

?????

 

 

What are the pros and cons of using this method?

Interrupts allow you to minimize the code you must execute during each loop and can help when very specific timing is needed (i.e., for an MP3 player). However, because you get less control over when your interrupt function gets called, you have to handle things like debouncing so that you don't count one event as multiple.

 

 

Part D-3  (-0.5)?

Video (-0.5)?

we will reinstate the 1/2 point if you uploads the video, and sends an email to zahraa@stanford.edu letting us know of the update.