• This topic has 4 replies, 2 voices, and was last updated 11 years ago by Anonymous.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #2148
    Anonymous
    Inactive

    Hi,

    I wanted to start by saying thanks for this awesome library.  It has made my project so much easier.  I have a quick question however.  I am trying to have the MP3 shield turn off if a song is not playing with a simple if statement like this

    if (MP3player.isPlaying() != TRUE){

    MP3player.end();

    }

    However, I keep getting an error stating “class SFEMP3Shield’ has no member named ‘end'”  Now I know the library is loaded as all the other commands work and even the command “end” shows up in orange.  Anyone have any ideas on this?

     

    Also is this the best way to conserve battery life?  What I have made is not going to be playing an MP3 all that often.

     

    Thanks

    #2149

    Strange. Please, note in the current example MP3Shield_Library_Demo.ino :


    } else if(key_command == ‘O’) {
    MP3player.end();
    Serial.println(F(“VS10xx placed into low power reset mode.”));

    Compiles just fine. Since your reported error did not error on the isPlaying, It sounds like the library you have linked to is prior to 1.01.00, when SFEMP3Shield::end() was added.

    The SFEMP3Shield::end() function was created just for this; to save power. There is a low power soft mode, but the data sheet states the most power savings is done by putting the chip into reset. Which is what end() does. And you can come out of reset by re-initializing the VS1053 by calling SFEMP3Shield::vs_init(). No need to re-call SFEMP3Shield::begin() which only deals with the Arduino’s pins.

    Hence the MP3Shield_Library_Demo.ino example has


    } else if(key_command == ‘R’) {
        MP3player.stopTrack();
        MP3player.vs_init();
        Serial.println(F(“Reseting VS10xx chip”));

     

    #2150
    Anonymous
    Inactive

    Thanks for your help! So you hit the nail on the head with the problem.  I started this project last summer and had not realized that the library had updated.  I updated the library and I no longer have the error.  However, I now have this one.

    SFEMP3Shield/SFEMP3Shield.cpp.o: In function `SFEMP3Shield::begin()’:

    /Users/sqeekypotato/Documents/Arduino/libraries/SFEMP3Shield/SFEMP3Shield.cpp:99: undefined reference to `sd’

    This sketch was working (and is currently running on my Arduino with the old library)

    I’ve made sure that I have the most recent SD library in case that was the problem and it didn’t fix it.  I also tried compiling sketches that I had installed on my Arduino successfully before updating the library and I am getting the same error.  The thought just occurred to me, when I started working on this project, following the instructions on Bill Porter’s website, I changed a setting in a header file (I can’t remember what file or what I did off the top of my head).  Is this still required?  Would this be screwing it up?

    Any suggestions?  Thanks again for the help

     

     

    #2151

    Please look at the Git Hub Project Page’s Trouble Shooting Guide

    It explains the problem you are seeing.

    Note the following in the examples, as to instanciate the sd prior to its use.

    SdFat sd; // newly required in 1.01.00 and higher

    #2152
    Anonymous
    Inactive

    That fixed it.  Thank you, you are awesome.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.