Giter Club home page Giter Club logo

Comments (5)

PowerBroker2 avatar PowerBroker2 commented on August 25, 2024

Thank you!

In terms of your question, you would use

void playFolder(uint8_t folderNum, uint8_t trackNum);

to play a given track in a given folder. Keeping track of what folder number corresponds to what album and what track number corresponds to what song will be up to you since there's no way to query folder/track metadata. You could create a const array in program memory to serve as an album/track lookup table (or something like it) to keep track of what corresponds to what.

Does that help?

from dfplayermini_fast.

Chris-Blackwell avatar Chris-Blackwell commented on August 25, 2024

Thank you for the reply. I did implement pulling the folder and the file from the rfid card, but I am having trouble with how to play the next x number of songs. I have a third variable on the card which is the number of tracks on the album. The method isPlaying() is always returning as 1 for me. I am just having trouble trying to figure out how to loop through the tracks i want to play. I have something like the following loop (pseudocode):

while (track < albumCount){
    value = mp3.isPlaying();
     if (value == false){
         delay(1000);
          mp3.playFolder(folder,track);
          value = mp3.isPlaying();
           track++;
           }else{
              delay(1000);
  } 

Thanks again for any feedback.

from dfplayermini_fast.

PowerBroker2 avatar PowerBroker2 commented on August 25, 2024

It would be better to poll the DFPlayerMini's busy pin instead of using the isPlaying() method. You can do something like this:

while (track < albumCount)
{
  if (!digitalRead(BUSY_PIN))
  {
    mp3.playFolder(folder, track);
    track++;
  }
}

where BUSY_PIN is defined by the digital input pin on the Arduino connected to the busy pin of the DFPlayerMini.

from dfplayermini_fast.

Chris-Blackwell avatar Chris-Blackwell commented on August 25, 2024

LOL I literally just implemented that right before you posted that! I am cycling through the tracks right now. Great minds! (Not saying I have a great mind though, lol). Thank you so much for your help.

from dfplayermini_fast.

PowerBroker2 avatar PowerBroker2 commented on August 25, 2024

lmao, glad it's working!

from dfplayermini_fast.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.