error message when compiling sketch for mp3 shield

hi/help.

I'm kind of new to this. The example code for my mp3 shield will not compile, even though its in the Arduino Examples library. The sketch is the MP3Shield Library Demo

error messages

Arduino: 1.8.12 (Windows Store 1.8.33.0) (Windows 10), Board: "Arduino Uno"

C:\Users\King\Documents\Arduino\libraries\SFEMP3Shield\SFEMP3Shield.cpp:25:37: error: variable 'bitrate_table' must be const in order to be put into read-only section by means of 'attribute((progmem))'

PROGMEM uint16_t bitrate_table[15][6] = {

^

C:\Users\King\Documents\Arduino\libraries\SFEMP3Shield\SFEMP3Shield.cpp: In member function 'uint8_t SFEMP3Shield::vs_init()':

C:\Users\King\Documents\Arduino\libraries\SFEMP3Shield\SFEMP3Shield.cpp:235:34: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

if(VSLoadUserCode("patches.053")) return 6;

^

exit status 1
Error compiling for board Arduino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Thank-you

Are you sure it's in the "Arduino examples"? Library example sketches are listed along with standard sketches in "Examples from Custom Libraries" heading. They appear there automatically as soon as the library is installed and the IDE is run. It is not any indication of IDE compatibility.

It is not uncommon for version updates to break code in previously written libraries. How old is the library?

Hi thanks for replying.

The version I have is from Sparkfun, and the file is dated 9 Feb 2018. I suspect it is older, as I have found it all over the internet.

Shaun

There have been changes made, that affect how PROGMEM must be implemented. Honestly, I haven't used PROGMEM since that happened so someone else will have to explain. However, it might be covered in the Arduino documentation. Have a look there.

I guess to get to the crux of my problem: I'm new at this, and trying to help my wife build a haunted dollhouse. I bought a mp3 shield from Geeetech (MP3 1053 Module TF Card); trying to find a sketch to run it.

Can you recommend one?

Shaun

Please provide a clickable web link to the shield you bought.

Here it is, thanks:

https://www.geeetech.com/arduino-mp3-shield-board-with-tf-card-p-604.html

Geeetech is providing a version of the SFEMP3Shield library that is at least seven years out of date!

The issue you are experiencing was fixed seven years ago by the library's author, so you could fix this by updating the library. However, there is a note in the readme of the modern version of that library:

This project and support has been migrated to Arduino_Library-vs1053_for_SdFat, where "VS1053 for use wiht SdFat" is availabe directly from the Arduino IDE Library manager for download.

This instance of the project is effectively closed, please submit all issues and pull requests to Arduino_Library-vs1053_for_SdFat

So my advice is for you to use the "VS1053 for use with SdFat" library instead. You can install it by following these instructions:

  • (In the Arduino IDE) Sketch > Include Library > Manage Libraries
  • Wait for the download to finish.
  • In the "Filter your search..." field, type "VS1053 for use with SdFat".
  • Press Enter.
  • From the search results, click on "VS1053 for use with SdFat by Michael P. Flaga, Bill Porter".
  • Click the "Install" button.
  • Wait for the installation to finish.
  • Click the "Close" button.

You will now find example sketches that demonstrate how to use the library under File > Examples > VS1053 for use with SdFat.

hi

Thanksf or the tip. still getting errors.

Arduino: 1.8.12 (Windows Store 1.8.33.0) (Windows 10), Board: "Arduino Uno"

fileplayer:29:10: fatal error: SdFat.h: No such file or directory

#include <SdFat.h>

^~~~~~~~~

compilation terminated.

exit status 1
SdFat.h: No such file or directory

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

When you see a "No such file or directory" error it almost always means you need to install the library that contains the missing file.

Often the code you're compiling will come with documentation (either a comment or separate document) that tells you where to get the library dependencies.

Note that libraries may have dependencies on other libraries.

In other cases the author of the code will not have been so kind and you'll need to go on a hunt for the missing library.

A good place to start is the Arduino IDE's Library Manager:

  • Sketch > Include Library > Manage Libraries...
  • In the "Filter your search..." box, type some keywords you have gleaned from the missing file name.
  • Scroll through the results for the right library. Click on it.
  • Click "Install".
  • Wait for installation to finish.
  • Click "Close".
  • Try compiling your code again.

If you have no luck in Library Manager then load up your favorite search engine and do a search for the missing filename. You will often get multiple results. If you have a lot of results you might add "arduino" as an additional search keyword. I will usually prefer results on github.com since that is where most Arduino libraries are hosted and downloading from there is fast and easy. In some cases there will be multiple libraries that contain the given filename and you'll need to do some evaluation to determine which seems the most appropriate, then try it out. After downloading the library you found you'll need to install it. This requires a different process than the Library Manager installation. You will find instructions here: