Hello,
I would like to open a text file to read some values. I already did it with the SD card reader module but I would like to do it with the mp3 DFplayer module, so that I can play some sounds indicated in that file, on the same SD card. Is it possible?
That sounds possible
- read text from the file as you would from any SD card adapter
- parse the data in the file
- interpret the data
- play the required music file
Where are you stuck ?
I still didn't try but I'm sure the code I use with the card reader which use Miso, Mosi and Sck pins (serial software library) won't work with DFplayer because it has no these pins... How could it be compatible?
My aplogies
An SD card reader does not necessarily need to use the SPI interface, but it appears that the DFRobot library does not have a function to read a text file from its SD card reader. To my mind this is an unfortunate omission. Sorry for getting your hopes up
You could, however, use your other SD card reader to read a text file from a second SD card
As far as I know all the variants of these MP3 players do not allow direct read/write access to the SD card from user code. The SD card is only used to store the MP3 files and the module plays the tracks as instructed using the serial comms protocol or digital I/O.
It's a really a shame to use 2 SD cards but ok, if it's the only possibility. Thanks for the confirmation;)
You did not specify which Arduino you're using. But a number of them have EEPROM that can be used instead of (a second) SD card; you will have to do the calculations if the internal EEPROM is big enough.
You can write a small PC application to store songs on the SD card and at the same time write add the relevant data to EEPROM.
If your board does not have internal EEPROM, you can use an external EEPROM or FRAM module.
You mean to add some bytes for my data directly inside a mp3 file? How can I retrieve them if I can't access to the files of SD card because I can only play them? And why in the EEPROM in this case? If I can get them, I don't need to use EEPROM, I use them directly in my code. Not sure to understand your process.
For now the only solution I see is to use the DFplayer module for playing MP3 files and use an external SD card reader just for the data.
I can't use the EEPROM because I don't want to modify the code to change my data. I want we to access to the data from an external file without the need of a new code compilation
You don't have to modify your code each time that you change the mp3 files; in it's most basic form, you can use serial monitor to update the EEPROM. You will have to implement the functionality once.
Ok, I didn't know it was possible to write in the EEprom without compiling the code. I'm going to find a tutorial...
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.