Jump to content
guigro

Music Shield 1.2 example not working

Recommended Posts

Hello !!

 

I just bought your Music Shield v1.2 and can't find a way to make it work.

 

I have an input device (that I don't know how to connect to the Arduino as the shield takes all the pins, do you have an hint on that ?) and I followed all steps given on your Wiki and Tutorial.

 

First I got errors about the WProgram.h not found, I replaced it with Arudino.h

Then I got errors with the NewSoftSerial.h that I replaced with SoftwareSerial.h

 

Then I get a looot of errors.

 

Is there any update ? It seems the code are made for Arduino 1.0 as I'm running 1.7.6

 

Thanks a lot !
Regards,
Guillaume

Share this post


Link to post
Share on other sites

Hi !

 

I use an Arduino.

 

I downloaded the files from the Wiki, changed the libraries and the portpin file.

 

Then I tried to compile the music example, got errors from WProgram.h.

I changed all occurences of WProgram.h to Arduino.h

 

And I got errors from NewSoftSerial

I changed all occurences of NewSoftSerial to SoftwareSerial

 

Then I got errors from the 1.17 version of the library.

I deleted this library to be sure not to have conflict.

Youpi I was able to compile the program and send it to my Arduino !

 

But... I'm sure there is a .wav file in the SD card.

And when I put the Arduino to ON, when I press to play nothing happens (I tried to put the volume up and everything I could have done).

 

How can I make it work ?

Thanks !

Regards,

Guillaume

Share this post


Link to post
Share on other sites

Hi !

Thanks for your answers :)

 

I managed to make it work.

 

Altough I have a question :

 

I would like to trigger Play and Pause regarding an INPUT.

 

It's a magnetic switch, and I would like to :

- If the switch is closed : play the music

- If the switch is open : pause the music OR mute the volume

 

But I can't manage to do it. My switch is showing 1 and 0 well (so it's working), but nothing happens to the sound.

Can you help me with that ?

For information : I use an Arduino Mega

 

Thanks a lot !

 

Here if my code :

#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()
{
  pinMode(24,INPUT);
  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()
{ 
 if (digitalRead(24) == 0) {
  
  Mp3SetVolume(0,0);
 
 Play();
 }
 
 if(digitalRead(24) == 1) {
 
  Mp3SetVolume(40,40);
  } 
  
  Serial.println(digitalRead(24));
  
}

Share this post


Link to post
Share on other sites

Altough I have a question :

 

I would like to trigger Play and Pause regarding an INPUT.

 

It's a magnetic switch, and I would like to :

- If the switch is closed : play the music

- If the switch is open : pause the music OR mute the volume

 

But I can't manage to do it. My switch is showing 1 and 0 well (so it's working), but nothing happens to the sound.

Can you help me with that ?

For information : I use an Arduino Mega

 

Just to make it straight:

 

You are using Arduino Mega and music shield. You managed to make music shield work and it is playing music without problems? Now you want to control that playing (play/pause/mute) with a switch?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×