Esp32 + YX5300

niibee
Posts: 2
Joined: Fri Nov 18, 2022 7:15 pm

Esp32 + YX5300

Postby niibee » Sat Nov 26, 2022 4:15 pm

Hello dear fellas,
I have a devkit Esp32 and I want to play some mp3 with YX5300 device, below some pictures.
I have connected YX5300 to 3,3v (try also 5v) and to 16-17 pin for tx/rx. I use a 8 gig microsd formatted as FAT32 and created two folders 01 and 02 and inside of each some mp3 or wav file with name that begin with 001-, 002- and so on. I tried also 16gig microsd.
I attach my earset to the device, but I cannot listen anything. Led on board is always red (not good sign), when it should be green if it plays.
Here below my very simple code:

Code: Select all

#include <Arduino.h>
#include <MD_YX5300.h>
#include <SoftwareSerial.h>

const uint8_t esp32_RX = 16; // connect to TX of MP3 Player module
const uint8_t esp32_TX = 17; // connect to RX of MP3 Player module

SoftwareSerial MP3Stream(esp32_RX, esp32_TX); 

MD_YX5300 mp3(MP3Stream);
bool playerPause = true;

void setup()
{
  Serial.begin(115200);
  Serial.println("Start setup");
  MP3Stream.begin(MD_YX5300::SERIAL_BPS);
  mp3.begin();
  mp3.setSynchronous(true);
  mp3.volumeMax();
  Serial.println("End setup");
}

void loop()
{
  mp3.check(); 
  if (playerPause)
  {
    mp3.playFolderRepeat(2);
    playerPause = false;
    Serial.println("Playing");
  }
}
Where am I wrong?
WhatsApp Image 2022-11-26 at 17.13.32.jpeg
WhatsApp Image 2022-11-26 at 17.13.32.jpeg (96.51 KiB) Viewed 832 times
WhatsApp Image 2022-11-26 at 17.13.18.jpeg
WhatsApp Image 2022-11-26 at 17.13.18.jpeg (94.64 KiB) Viewed 832 times

Who is online

Users browsing this forum: Bing [Bot] and 24 guests