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

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

YulleBorges_Lab6

Page history last edited by Vivien Tsao 10 years, 7 months ago

Part B. Connect And Test Your Decoder 

 

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

One high-pitched note for one second then 1 second in silence then another high-pitched for 1 second followed by one second silence then a low-pitched note for a second. This tone is repeated after another second of silence.

Part C. Play Some Music! 

 

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

Done.

✓ lol... who did you tell this to?

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 only the songs in the root directory. Because the device is programmed to play all the files which the name is loaded to the arduino EEPROM and the only files that go to EEPROM are files .mp3 or .wav (verified in sd_dir_setup).

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

Done.

 

Part D. Pause to Learn About Interrupts 

 

What Happens when you press the button? What happens when you press the button 15 times in a row?

When I press the button, the LED lights up then turns off when I release the button. If I repeatedly press the button the inverts its function in a way that the LED is now ON and it goes OFF when I press the button (due to bouncing).   

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

YulleBorges_Lab6_ButtonSchematic.png

What are the pros and cons of using this method?

Interrupts:

pros: they take care of themselves and will execute their own code as long as the event is triggered (in this case, the press of the button) independently from the rest of the program.

cons: you can only use 4 interrupts in the whole program. If misused can become blocking code.

Bouncer(the debouncer):

pros: Easy to use and efficient.

cons: Requires an external library, doesn't natively work with interrupts

 

Comments (0)

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