Go Down

Topic: Seeed Studio Music Shield...Issues (Read 2436 times) previous topic - next topic

Paranemertes

Well I went out today and got myself a SeeedStudio Music Studio (http://seeedstudio.com/wiki/Music_Shield) All's been well with this library: http://seeedstudio.com/wiki/File:Music_v1_2.zip and this example code:

Code: [Select]

#include <avr/io.h>
#include "config.h"
#include "filesys.h"
#include "player.h"
#include "vs10xx.h"
#include "record.h"
#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3);//pin2-Rx,pin3-Tx(note: pin3 is actually later used as volume down input)

void setup()
{
 Serial.begin(9600);
 //Serial.println("Hello test!");
 mySerial.begin(19200);// used for receiving command data from the iPod dock.
 
 InitSPI();

 InitIOForVs10xx();

 InitIOForKeys();
 
 InitIOForLEDs();

 InitFileSystem();

 //VsSineTest();

 Mp3Reset();
 
}


void loop()
{
  Play();  
  while(1);
}



Woohoo for that, but now I want to designate a specific file to play when a certain button is pressed, pseudo code:

Code: [Select]

if(buttonState1 == HIGH){
Play(track001);
}
if(buttonState2 == HIGH){
Play(track002);
}
 

There is another library that says it can do just that: http://seeedstudio.com/wiki/File:Libraries_for_Music_Shield_20120619.zip
I tried this code:

Code: [Select]
//  File MusicPlayer.cpp
#include <Fat16.h>
#include <Fat16Util.h>
#include <NewSPI.h>
#include <arduino.h>
#include "pins_config.h"
#include "vs10xx.h"
#include "newSDLib.h"
#include "MusicPlayer.h"
MusicPlayer myplayer;
void setup()
{
 Serial.begin(9600);
 myplayer.begin();//will initialize the hardware and set default mode to be normal.
}
void loop()
{
 myplayer.setPlayMode(MODE_REPEAT_ONE);//set mode to repeat to play a song
 myplayer.playSong("Let Go");//play a song named with test.wav
 while(1);//If the mode is normal, it will stop when it finished playing all the songs in the playlist
}


No luck. Nothing happens, it does not play the track even though nothing in the SD card has changed. Has anyone else ran into this situation? Someone on the SeeedStudio forum had the same problem, http://www.seeedstudio.com/forum/viewtopic.php?f=16&t=2996 but the issue was never resolved. Thank you for any and all advice!
"It's Dr. Evil. I didn't spend six years in Evil Medical School to be called 'mister,' thank you very much."

Paranemertes

"It's Dr. Evil. I didn't spend six years in Evil Medical School to be called 'mister,' thank you very much."

robtillaart

no experience with the specific shield, but from your story I understand that the shield works with the first library but not with the second library.

Have you dived into the first lib as a quick look shows it has some means to play individual tracks.

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Paranemertes

Yeah I took a look at it, but I'm on a deadline for this school project so I didn't have time to mess around with it anymore. I got a Sparkfun MP3 shield instead, and that's working now. Thanks though!
"It's Dr. Evil. I didn't spend six years in Evil Medical School to be called 'mister,' thank you very much."

Go Up