| 
  • 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.

View
 

Du, Bang Lab 6

Page history last edited by zahraa@... 4 years, 9 months ago

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

 

Answer:

1) high

2) medium

3) low

They are all the same length (around 1 sec).

 

Tell a member of the teaching team what your song is (or better yet, play it for us).

 

Answer: Absolutely cuckoo. 

 

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?

 

Answer: It follows the order in the SD card. It does not play the text file due to it's not the MP3 document. 

 

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. 

 

Answer: change the volume to 180: unsigned char mp3_vol = 180;

 

Then write:  EEPROM.write(max_num_songs * max_name_len + 1, mp3_vol);   

                    unsigned char vol = EEPROM.read(max_num_songs * max_name_len + 1);

                    Mp3.volume(vol);

 

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

Answer: 

 

What are the pros and cons of using this method?

 

Answer: It can be active at any part of the loop.  However, the pin is limited and hard to define double click. 

 

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

 

Answer: attachInterrupt(1, pause, RISING); 

 

void pause ()

{

if(Flag == 0)

  {

    last_state = current_state;

    current_state = PAUSED;

    Flag = 1;

  }

  else

  {

    current_state = last_state;

    Flag = 0;

  }

}

 

 

 

 

 

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.

 

 

 

 

 

Comments (0)

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