Comments (5)
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.
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.
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.
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.
lmao, glad it's working!
from dfplayermini_fast.
Related Issues (20)
- .volume() doesnโt send data on first call unless debug interface is turned on HOT 4
- Example not working for me HOT 2
- Obscure quirk HOT 1
- play the second music after the first music is finished
- wierd play error
- Can't play songs in correct order HOT 1
- delay before playing sound ? HOT 1
- Play works only 90% of times HOT 1
- Octal error when playing from folder 08 or 09 HOT 1
- Using normalMode() does not work
- Loop vs Play
- RepeatFolder command - Doesn't play files in order?
- No Way To Tell If Command Is Finished HOT 1
- Faded in?
- Question HOT 1
- Low power mode HOT 1
- Compiling on stm32f103 or stm32f03xx
- DUDE I GET ANGER FOR THAT HOT 1
- Add a test method?
- DFPlayer Pro with this library?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dfplayermini_fast.