Hola amigos:
Tengo un problema intentando hacer funcionar el modulo mp3 de geetech vs1053 mp3 shield, al intentar inyectar el codigo original me devuelve este error:
C:\Users\Oscar\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] = {
^
Error de compilación
Este es el modulo:
http://www.geeetech.com/arduino-mp3-shield-board-with-tf-card-p-604.html
El programa asi como las librerias estan instaladas y descargadas de aqui:
http://www.geeetech.com/wiki/index.php/Arduino_MP3_shield_board_with_TF_card
Aqui os copio pego el codigo del sketch, a ver si alguien me puede indicar por que me devuelve este error
/**************************************
*
- Example for Sparkfun MP3 Shield Library
- By: Bill Porter
- www.billporter.info
- Function:
- This sketch listens for commands from a serial terminal (like the Serial Monitor in
- the Arduino IDE). If it sees 1-9 it will try to play an MP3 file named track00x.mp3
- where x is a number from 1 to 9. For eaxmple, pressing 2 will play 'track002.mp3'.
- A lowe case 's' will stop playing the mp3.
- 'f' will play an MP3 by calling it by it's filename as opposed to a track number.
- Sketch assumes you have MP3 files with filenames like
- "track001.mp3", "track002.mp3", etc on an SD card loaded into the shield.
***************************************/
#include <SPI.h>
//Add the SdFat Libraries
#include <SdFat.h>
#include <SdFatUtil.h>//and the MP3 Shield Library
#include <SFEMP3Shield.h>//create and name the library object
SFEMP3Shield MP3player;
SdFat sd;
SdFile file;byte temp;
byte result;char title[30];
char artist[30];
char album[30];void setup() {
Serial.begin(115200);
result = sd.begin(SD_SEL, SPI_HALF_SPEED);
//boot up the MP3 Player Shield
result = MP3player.begin();
//check result, see readme for error codes.
if(result != 0) {
Serial.print("Error code: ");
Serial.print(result);
Serial.println(" when trying to start MP3 player");
}Serial.println("Hello");
Serial.println("Send a number 1-9 to play a track or s to stop playing");}
void loop() {
if(Serial.available()){
temp = Serial.read();Serial.print("Received command: ");
Serial.write(temp);
Serial.println(" ");//if s, stop the current track
if (temp == 's') {
MP3player.stopTrack();
}else if (temp >= '1' && temp <= '9'){
//convert ascii numbers to real numbers
temp = temp - 48;//tell the MP3 Shield to play a track
result = MP3player.playTrack(temp);//check result, see readme for error codes.
if(result != 0) {
Serial.print("Error code: ");
Serial.print(result);
Serial.println(" when trying to play track");
}Serial.println("Playing:");
//we can get track info by using the following functions and arguments
//the functions will extract the requested information, and put it in the array we pass in
MP3player.trackTitle((char*)&title);
MP3player.trackArtist((char*)&artist);
MP3player.trackAlbum((char*)&album);//print out the arrays of track information
Serial.write((byte*)&title, 30);
Serial.println();
Serial.print("by: ");
Serial.write((byte*)&artist, 30);
Serial.println();
Serial.print("Album: ");
Serial.write((byte*)&album, 30);
Serial.println();}
/* Alterativly, you could call a track by it's file name by using playMP3(filename);
But you must stick to 8.1 filenames, only 8 characters long, and 3 for the extension */else if (temp == 'f') {
//create a string with the filename
char trackName[] = "track001.mp3";
// char trackName[] = "1.mp3";//tell the MP3 Shield to play that file
result = MP3player.playMP3(trackName);//check result, see readme for error codes.
if(result != 0) {
Serial.print("Error code: ");
Serial.print(result);
Serial.println(" when trying to play track");
}
}}
delay(100);
}