Load some MP3 files
Copy 2 MP3 files to a micro SD card and name them track001.mp3 and track002.mp3 (this is just for the test, you can re-name them later). Then push the uSD card into the slot on the shieldSimple Audio Player Sketch
Connect the Arduino to your computer with a USB cable and plug your headphones into the headphone jack. Select File->Examples->Adafruit_VS1053->player_simple to load the example code.Adafruit_VS1053_FilePlayer musicPlayer = // create breakout-example object! Adafruit_VS1053_FilePlayer(BREAKOUT_RESET, BREAKOUT_CS, BREAKOUT_DCS, DREQ, CARDCS); // create shield-example object! //Adafruit_VS1053_FilePlayer(SHIELD_RESET, SHIELD_CS, SHIELD_DCS, DREQ, CARDCS);
Adafruit_VS1053_FilePlayer musicPlayer = // create breakout-example object! //Adafruit_VS1053_FilePlayer(BREAKOUT_RESET, BREAKOUT_CS, BREAKOUT_DCS, DREQ, CARDCS); // create shield-example object! Adafruit_VS1053_FilePlayer(SHIELD_RESET, SHIELD_CS, SHIELD_DCS, DREQ, CARDCS);
If you get
Adafruit VS1053 Simple TestCheck that you commented out the breakout line and uncommented the shield line so it knows you're using a shield!
Couldn't find VS1053, do you have the right pins defined?
Interrupt/Background Version
Advanced users can also run File->Examples->Adafruit_VS1053->player_interrupts. This example demonstrates playing files in the background using interrupts. This allows you to do other things in your sketch while the music plays! It also has more error reporting and lists all the files found in the SD cardDon't forget to do the same thing, updating the:
Adafruit_VS1053_FilePlayer musicPlayer = // create breakout-example object! Adafruit_VS1053_FilePlayer(BREAKOUT_RESET, BREAKOUT_CS, BREAKOUT_DCS, DREQ, CARDCS); // create shield-example object! //Adafruit_VS1053_FilePlayer(SHIELD_RESET, SHIELD_CS, SHIELD_DCS, DREQ, CARDCS);
Adafruit_VS1053_FilePlayer musicPlayer = // create breakout-example object! //Adafruit_VS1053_FilePlayer(BREAKOUT_RESET, BREAKOUT_CS, BREAKOUT_DCS, DREQ, CARDCS); // create shield-example object! Adafruit_VS1053_FilePlayer(SHIELD_RESET, SHIELD_CS, SHIELD_DCS, DREQ, CARDCS);