I'm quite new to Arduino and also to this forum, so please help me out!
I want to build a sound effects box to connect with my Pocket Operators. Therefore I bought a Grove MP3 Player V4, but the only problem is that it doesn't seem to work at all.
I tried all the template codes from the Seeed wiki, but nothing seems to help.
I'm currently using an Arduino Grove version from a beginner kit, but I also have an Arduino Uno with a Grove kit on top. I'm using the standard UART port.
The SD card I'm using is 8GB and formatted as FAT.
I also couldn't find any good YouTube tutorials or template codes. Any help would be appreciated.
As a minimum all code in a code block and a photo of your hand drawn diagram of all the wires from end to end. Datasheets for any non standard parts.
Now we can see what you see and can start to work on it.
BTW,
no idea what that is.
need a link to that
Grove is a type of connector, so what does the following mean?
In your code, what do you mean "6 mei 2026 breeak" ? Is it a directory name or file name?
In the Wiki page you posted in #4, the signature of playSDRootSong() is:
uint8_t WT2605C<T>::playSDRootSong(uint32_t index) —— Specify the TF card root directory index for playback. This command indexes the files in the TF card for playback, affected by the order in which the files are stored, and the files are sorted according to the indexing order. The order of file indexing is according to the time when the files are copied to the TF card.
Input Parameters:
index: Play the index of the song.
But you specify the argument as a const char *.
If you want to specify the music file name, try:
uint8_t WT2605C<T>::playSDSong(const char* fileName) —— Plays music with the specified file name. (File names must be no larger than 8 characters)
Input Parameters:
fileName: The name of the music file you want to play.
No not really I just want to hear song 1 on the SD card when i push the button, It doesn't really have to be by song name Mp3Player.playSDRootSong(1) is fine.
Yes, there are indeed several Google results, but none of them really seem to match my specific use case. Also, I specifically need the V4 version, not the V2 or V3, so I was under the impression that those examples wouldn't be very helpful.
I chose this MP3 player because it seemed easy to connect to my Grove Base Shield, and it already has both an AUX output and a speaker output.
For the second time I tried the demo code from the wiki.seediuno site.
This time i got more response, I could see the ui in the serial and it als responded to my commands!
Still no sound...
For now I'm going to figure out if it has something to do with my sd card.
Code:
#include "WT2605C_Player.h"
#ifdef __AVR__
#include <SoftwareSerial.h>
SoftwareSerial SSerial(2, 3); // RX, TX
#define COMSerial SSerial
#define ShowSerial Serial
WT2605C<SoftwareSerial> Mp3Player;
#endif
#ifdef ARDUINO_SAMD_VARIANT_COMPLIANCE
#define COMSerial Serial1
#define ShowSerial SerialUSB
WT2605C<Uart> Mp3Player;
#endif
#ifdef ARDUINO_ARCH_STM32F4
#define COMSerial Serial
#define ShowSerial SerialUSB
WT2605C<HardwareSerial> Mp3Player;
#endif
void setup() {
while (!ShowSerial);
ShowSerial.begin(9600);
COMSerial.begin(115200);
ShowSerial.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++");
Mp3Player.init(COMSerial);
ShowSerial.println("0...");
}
void loop() {
if(ShowSerial.available()) {
String input = Serial.readString();
input.trim();
if(input.startsWith("v")) {
int vol = input.substring(1).toInt();
int err = Mp3Player.volume(vol);
ShowSerial.println(err);
if(!err) ShowSerial.println("Volume set to: " + String(vol));
else ShowSerial.println("ERROR");
}
else if(input.startsWith("m")) {
if(input.substring(1) == "1"){
ShowSerial.println("1");
int err = Mp3Player.playMode(0x00);
ShowSerial.println(err);
if(!err) ShowSerial.println("The playback mode is set to Loop mode.");
else ShowSerial.println("ERROR");
}
else if(input.substring(1) == "2"){
ShowSerial.println("2");
int err = Mp3Player.playMode(0x01);
ShowSerial.println(err);
if(!err) ShowSerial.println("The playback mode is set to Single song loop mode.");
else ShowSerial.println("ERROR");
}
else if(input.substring(1) == "3"){
ShowSerial.println("3");
int err = Mp3Player.playMode(0x02);
ShowSerial.println(err);
if(!err) ShowSerial.println("The playback mode is set to Folder loop mode.");
else ShowSerial.println("ERROR");
}
else if(input.substring(1) == "4"){
ShowSerial.println("4");
int err = Mp3Player.playMode(0x03);
ShowSerial.println(err);
if(!err) ShowSerial.println("The playback mode is set to Random mode.");
else ShowSerial.println("ERROR");
}
else if(input.substring(1) == "5"){
ShowSerial.println("5");
int err = Mp3Player.playMode(0x04);
ShowSerial.println(err);
if(!err) ShowSerial.println("The playback mode is set to Single song mode.");
else ShowSerial.println("ERROR");
}
}
else if(input.startsWith("b")){
int index = input.substring(1).toInt();
Mp3Player.playSDRootSong(index);
ShowSerial.println("Play music: " + String(index));
}
else if(input.startsWith("+")){
int err = Mp3Player.volumeUp();
if(!err) ShowSerial.println("Volume up");
else ShowSerial.println("ERROR");
}
else if(input.startsWith("-")){
int err = Mp3Player.volumeDown();
if(!err) ShowSerial.println("Volume down");
else ShowSerial.println("ERROR");
}
else if(input.startsWith("n")){
Mp3Player.next();
ShowSerial.println("Next song");
}
else if(input.startsWith("p")){
Mp3Player.previous();
ShowSerial.println("Previous song");
}
}
}
I checked the return value of playSDRootSong() as you recommended.
I switched before code to the after and this was the result in the serial: Play music: 0 with ret: 255
255 means that the execution of playSDRootSong() failed.
I doubt other commands may also fail. For example, try executing a command to change the volume. (You'll probably need to input +, - or v5 into the serial monitor.)
If ERROR is displayed, you should check the hardware connections, pin assignments, and SoftwareSerial settings.