DFPlayer won't play selected file

Hi,
I'm a student and new with working on project using this DFPlayer and I have problem when working this project. When I'm trying to make the DFPlayer play selected file, its not working (literally didn't play any single files). This is the code I'm using

#include "SoftwareSerial.h"
#include "DFRobotDFPlayerMini.h"

SoftwareSerial softwareSerial(10, 11); //RX || TX
DFRobotDFPlayerMini player;

void setup()
{
  pinMode(2,INPUT);
  player.volume(30);
  softwareSerial.begin(9600);
  player.begin(softwareSerial);
}

void loop()
{
  if(digitalRead(2) == HIGH)
  {
    delay(3000); player.play(1);
  }
}

But when I'm using player.next () like this one

#include "SoftwareSerial.h"
#include "DFRobotDFPlayerMini.h"

SoftwareSerial softwareSerial(10, 11); //RX || TX
DFRobotDFPlayerMini player;

void setup()
{
  pinMode(2,INPUT);
  player.volume(30);
  softwareSerial.begin(9600);
  player.begin(softwareSerial);
}

void loop()
{
  if(digitalRead(2) == HIGH)
  {
    delay(3000); player.next(); delay(200);
  }
}

The DFPlayer is playing all files (every single one). Can someone help me solve this problem?

Thank you very much in advance and I truly appreciate your responses.

Note :

  • the files is already 0001.mp3 and so on
  • the files put in the one and only folder named mp3
  • the SD Card already FAT32

This will get called every 3.2 seconds while pin 2 is HIGH
What is connected to pin 2?

Its a button for a signal to play the file

How is it wired?
It does have a pull-down resistor, right?

It is. I also already trying changing the value I'm using between 330 - 4,7k

That will make no difference as the resistor value is not critical anything around 10K will do.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.