music shield sd card won't initialize

Hi

I have a V2.0 music shield which fails when initializing the SD card. The output I get is:
ClockF:C000
error: card.init failed
SD error:1

there are no lights lighting up on the music shield, although I can hear the odd click happening through the headphones.
The music shield control button has no effect.
The code is the creatList program from the Wiki, although I have tried others with the same result.
I have tried using an Arduino UNO and Seeedstudio and also three different music shields.
The micro SD card is a Sandisk 2GB, I have tried two different ones, and also another brand, all 2GB.
I have tried formatting to FAT16 and FAT32, on two different computers.
I have reinstalled the software, it is the latest library from the wiki.
Other applications on the Uno and Seeedstudio work fine, I am just having no luck in getting this music shield to work.

There must be something I am missing, and I am almost expecting it to be something quite simple that I have missed!.. or I hope so :slight_smile:

If anyone is able to offer a suggestion please do as I am at a loss.

Greg

Hi maybe there is something wrong with your library , you can delete your older libraries (Fat16 and Music) and then download this attachment , have a try.

Any questions you can show it with us.
Music.rar (77.3 KB)

Thanks Jacket! that worked. Does it mean the files that are on the Wiki are wrong?

hi, I have another question.

All is going sweet but the function I am wanting to do is for the arduino / shield to start playing a song, then while playing, do other functions, like flash LEDs and also some PWM output. However once the song starts playing the code pauses until the song finishes. Is there a way to have a song play while simultaenously doing other control work with the arduino?
Thanks
Greg

Maybe you can delete the function of flash.So you can use the pin of PWM, or ues other pin of PWM.

Hi Jacket,

yes I can get the PWM to work and stay at a certain percentage, but I want to be able to do other things too while a song is playing (like control some LEDs from a timer). Is there any way to start a song then while the song is playing be able to do other code functions. It seems like as long as a song is playing the main code loop pauses until the song finishes. If this is the way it works then I would like to know so I don’t keep trying to find a solution.

thanks
Greg

Hi , of course you can do other things while playing a song/songs , you need know what pins the Music Shield has been used first , and modify your code(add other functions to your program). Maybe you can show us your program , so we can talk about it .

My pc wont export my program but here is the core part of the sort of code I am trying to do. This should hopefully start the song and flash an LED once a second while the song is playing. But the LED doesn’t start flashing until the song is finished. Is there a way to make the song start and then do other things while the song is still playing? I have tried different pins for the Led but I am pretty sure this is not the problem.

long ledMillis;
long currentMillis;
int ledOn = false;
int ledPin = 2;
MusicPlayer myplayer;

setup ()
{
pinMode (ledPin, OUTPUT);
Serial.begin (9600);
myplayer.begin();
}

void loop()
{
myplayer.setPlayMode(MODE_NORMAL);
myplayer.playSong(“test.mp3”);

for (;:wink:
{
currentMillis = millis();
if (currentMillis > ledMillis + 1000)
{
if (ledOn == true)
{
digitalWrite (ledPin, LOW);
ledOn = false;
}
else
{
digitalWrite (ledPin, HIGH);
ledOn = true;
}
ledMillis = currentMillis;
}
}
}

I got a copy of the program to attach. Like I say I want the LED to flash while the song is playing, not afterwards.

thanks
Greg
music_shield_ledtest.zip (600 Bytes)

did anyone have any luck getting this to work? I still haven’t found a way to process other code while a song is playing

Hi , you can refer to the library of MusicPlayer.cpp , and you can find that when you run the function (myplayer.playSong(“test.mp3”); ), you can’t do anything but wait.The program run in this function and could be released still the song have stoped. So if you want to run a another function while runing myplay.playSong, you need a interrupt funciton.

By the way,the D1 will flash while the song playing, and digital 8 has connected to D1. So you can also connect a external Led to digital 8,and the external Led will flash too while the song playing .

:angry: too prolix…