Home › Forums › Sparkfun MP3 Shield Library Support Forum › SFEMP3Shield + Arduino Uno + SeedStudio MusicShield v1.13
Tagged: MusicShield, SeeedStudio, Uno
- This topic has 0 replies, 1 voice, and was last updated 10 years, 2 months ago by Anonymous.
-
AuthorPosts
-
December 16, 2014 at 7:54 am #3252AnonymousInactive
Hello,
I am trying to get your lib working on an Arduino Uno (R2) and SeeedStudio MP3Shield v1.13
I am using Arduino IDE v1.0.5 on a 64 bits Ubuntu envrionment.
I first tried what SeeedStudio provides, but it’s for very old versions of Arduino IDE and there are a lot of zip files floating around, it’s hard to pick the right one.So far:
-I edited SFEMP3ShieldConfig.h:
#define SEEEDUINO 1
#define USE_MP3_REFILL_MEANS USE_MP3_SimpleTimer-Then I compiled MP3Shield_library_demo :
Binary sketch size: 29,994 bytes (of a 32,256 byte maximum)
-But I failed uploading it : “Problem uploading to board”… message
avrdude: stk500_recv(): programmer is not responding-So I copied MP3Shield_Library_Demo.ino to MP3Shield_Small_Demo.ino and I mostly commented what I didn’t need to save some space. I got rid of some features and of the help command. It compiles fine :
Binary sketch size: 27,638 bytes (of a 32,256 byte maximum)
-And this time I can upload it
-It complains about the SD card that can’t be initialized:-So I edited the example:
#if 0
if(!sd.begin(SD_SEL, SPI_FULL_SPEED)) sd.initErrorHalt();
#else
pinMode(SD_SEL, OUTPUT);
if(!sd.begin(SD_SEL, SPI_FULL_SPEED)) {
sd.initErrorHalt();
}
#endif
F_CPU = 16000000
Free RAM = 865Invalid format, reformat SD.But the ‘QuickStart’ example from SdFat can list all the files from this card without any problem.
Questions:
-So is the free RAM a problem here?
-Does it work With Arduino Uno R2?
-Also, does your lib support MP3Shield v1.x?
On their website they say that V1.0 and V2.0 are not compatible, so I would expect you to either have flags for each version or to only support a single version of the board.Then I tried a modified version of Mp3PlayerButton2 :
PlayTrack() returns 0 when I start it the 1st time and 1 when I call it on another track
If I try to call stopTrack(), it just freeze.
I have track000.mp3 and a track001.mp3 files on the SD card, they’re both encoded at 128kb/s.// libraries
#include <SPI.h>
#include <SdFat.h>
#include <SdFatUtil.h>
#include <SFEMP3Shield.h>// Below is not needed if interrupt driven. Safe to remove if not using.
#if defined(USE_MP3_REFILL_MEANS) && USE_MP3_REFILL_MEANS == USE_MP3_Timer1
#include <TimerOne.h>
#elif defined(USE_MP3_REFILL_MEANS) && USE_MP3_REFILL_MEANS == USE_MP3_SimpleTimer
#include <SimpleTimer.h>
#endifSdFat sd;
SFEMP3Shield MP3player;
void setup() {
Serial.begin
(115200);if(!sd.begin(10, SPI_HALF_SPEED)) sd.initErrorHalt();
if (!sd.chdir(“/”)) sd.errorHalt(“sd.chdir”);MP3player.begin();
MP3player.setVolume(254,254);}
void loop() {
// Below is only needed if not interrupt driven. Safe to remove if not using.
#if defined(USE_MP3_REFILL_MEANS) \
&& ( (USE_MP3_REFILL_MEANS == USE_MP3_SimpleTimer) \
|| (USE_MP3_REFILL_MEANS == USE_MP3_Polled) )MP3player.available();
#endif
uint8_t retVal;
delay(1000);
Serial.print(F(“Start Playing first Track “));
retVal = MP3player.playTrack(0);
Serial.print(retVal);
delay(10000);
//MP3player.stopTrack();Serial.print(F(“Start Playing second Track “));
retVal = MP3player.playTrack(1);
Serial.print(retVal);
delay(10000);
MP3player.stopTrack();
}I tried to use USE_MP3_Polled :
#define USE_MP3_REFILL_MEANS USE_MP3_Polled
It still doesn’t work but it seems to use less RAM:because I’ve 1039 bytes left instead of 865Last minute : I switched back to volume = 10 instead of 254 and now I can hear a little something for 1 second, but then it stops.
Any idea on why it fails?
-
AuthorPosts
- You must be logged in to reply to this topic.