Home › Forums › Sparkfun MP3 Shield Library Support Forum › compile error: variable ‘bitrate_table’ must be const › Reply To: compile error: variable ‘bitrate_table’ must be const
Hi All,
OK I got all problems solved now!
The example program from http://www.billporter.info/2012/01/28/sparkfun-mp3-shield-arduino-library/
needs to be adapted for Arduino IDE version 1.0.3. The code I got working is:
/code {simple_mp3_example.ino}
#include <SPI.h>
#include <SdFat.h>
#include <SdFatUtil.h>
#include <SFEMP3Shield.h>
SdFat sd;
SFEMP3Shield MP3player;
void setup() {
Serial.begin(9600);
//start the shield
// MP3player.begin();
if(!sd.begin(SD_SEL, SPI_HALF_SPEED)) { sd.initErrorHalt(); } // newly required in 1.01.00 and higher
if(MP3player.begin() != 0) {Serial.print(F(“ERROR”)); }
//start playing track 3
MP3player.playTrack(3);
}
//do something else now
void loop() {
Serial.println(“I’m bored!”);
delay(2000);
}
/end code {simple_mp3_example.ino}
So conclusion2:
1). MP3 player shield on Ubuntu 12.10 (64-bits) does not work with supplied version 1.0.1 of Arduino IDE. Instead version 1.0.3 needs to be downloaded from Arduino website (http://arduino.cc/en/Main/Software).
2). The simple MP3 player shield code (from website: http://www.billporter.info/2012/01/28/sparkfun-mp3-shield-arduino-library/) needs to be updated to the code written above in this post ({simple_mp3_example.ino}).
Thats all. I hope this also helps other people, as it took be some time to work this all out!
Cheers,
Mikel