Forget about them, I was not very lucky to think of them.
Yes, that is correct.
A piece of advice, think about joining one of the busy pins of a Dfplayer, (the one with the longest track), to a nano pin, for example pin 11, and configure it in the setup as input .The two lines for which you asked before would remain like this.
delay (250);// small delay for the players to march
// BUSY on LOW = Dplayer playing.
while (digitalRead (11) == LOW); //Code stopped here until finished playing.
I keep getting this error when I attempt to load. At first I assumed I had no installed the correct libraries....but I couldn't find some of them. What am I doing wrong?
Using library dabble_1_5_2 at version 1.5.2 in folder: /home/builder/opt/libraries/dabble_1_5_2
Using library DFRobotDFPlayerMini at version 1.0.5 in folder: /mnt/create-efs/webide/30/87/30871033152602bab473541291b9b5fc:kbed/libraries_v2/DFRobotDFPlayerMini
/home/builder/opt/libraries/latest/dabble_1_5_2/src/SoftwareSerial.cpp:45:10: fatal error: util/delay_basic.h: No such file or directory
This may be unnecessarily complicated. As far as we know from how @kbed has described the project, only one serial port is needed. The TX pin can be connected to all 4 players in parallel. The RX pin does not need to be connected at all, as no data needs to be recieved back from the players. (Only certain library functions need the RX connection, and they are often not needed in a project, such as querying the volume level or querying whether a track is playing.)
@kbed can prepare each of the 4 SD cards so that track 1 is a different MP3 file on each card.
Yes, i attempted to load the above code and got that error.
And just so you are aware, i have done enough reserach to understand the quirks of the dfplayer and have formatted the microsd cards accordingly. I already have four sd cards loaded in four different dfplayers each with its own track. I have tested one independently of the arduino to make sure the formatting is correct. I will be doing so to the other three this afternoon.
Sketch uses 3696 bytes (12%) of program storage space. Maximum is 30720 bytes.
Global variables use 381 bytes (18%) of dynamic memory, leaving 1667 bytes for local variables. Maximum is 2048 bytes.
No problem at all. I only needed to install the DFRobotDFPlayerMini library through the library manager in the IDE:
Good. Forget the stereo approach I mentioned. I don't know where your four speakers will be, but say they will be in four different rooms, each playing a message in one particular language. Nothing from the left track should leak to the right track. I don't know whether anything in the DFplayer makes it leak. I don't know if anything in the MP3 format makes it leak. The latter might be more plausible. A heavily packed MP3 file might separate low frequencies from high frequencies and mix the low parts down to a mono channel to minimize file size.
It should verify and upload with no difficulty. There seems to be a problem with the IDE on your PC/laptop.
Try uninstalling the DFRobotDFPlayerMini library, and any other similar libraries, then re-install the latest version of the DFRobotDFPlayerMini library.
What version of the IDE are you using, what version of the library and what OS are you using?
I am super appreciative of your help, but I will be honest...much of what you just said went right over my head.
I am using the web editor here at arduino.cc. I have tried this from both my mac and a pc. I get the same thing when it comes to the nanos (I have tried two different ones). i have used two different cords. What I am getting now is "Error uploading, check if the selected board is currently available."
i have selected the right board on the right port and when I plug it in it confirms that it is plugged in.
This seems like such an idiotic place to be stuck here. I have no idea what I am doing wrong. I have connected and uploaded code before.
Oh, I have no experience of using that. I have always used the installed IDE on my PC/laptop.
Ok, this is a step forward. The previous error you were getting was a compilation/verification error. This type of error appears before any attempt is made to upload the code to the Arduino. It seems that is now somehow fixed, because this new error is about uploading the compiled code to the Arduino.
Could you install the Arduino ide on your pc/laptop? Don't go for the latest 2.x version yet, it is still relatively new. I currently use 1.18.13 version, and at least we know the code will compile ok with that version.
EDIT: looks like 1.18.13 is no longer available for download, so try 1.18.19.
Thank you for the support on this project. I have been silent on this for the last week out of desperation. It was either take a break from this project or burn the damn house down. Ultimately, I got it to work. For the longest time it was not working and I couldn't figure it out. Then, I realized I should test the boards I was using. When NONE of them worked uploading a simple blinking light code I realized that the issue was with my computer. After researching it I found that this has happened to others....apparently Arduino.cc doesn't like some Macbooks that use USB-C. I was plugging my arduino into a USB-C adapter. It would register that I had connected the board. It appeared like it was uploading code...but it wasn't. That is why I couldn't get this to work, I simply wasn't loading any code onto the board to begin with. My workaround was simply to use a different computer.
Thank you all for the help. I have learned a lot from this.....but in coding and otherwise.
This never ending project seems to be, well, never ending. I thank you all for the help and I am pleased to say I have a functional model that is past the breadboard stage. I have learned a LOT during this project. Thank you.
I am having one minor issue and I know what the fix is, I just want to get your advice on how to implement to code into existing code I have.
Here is the issue. I am using three 15 watt amplifiers but, they are on all of the time and you can hear them. I am going to power them through a single relay so that they are only powered on when the device is triggered. This brings up a couple of issues. First, let me begin by posting the code I am using from above:
`#include "Arduino.h"
#include "SoftwareSerial.h"
#include "DFRobotDFPlayerMini.h"
//Start serial port
SoftwareSerial mySeria1(3, 4); // RX, TX dfplayer 1
// We declare variables for the dfplayer
DFRobotDFPlayerMini DFPlayer1;
void setup() {
// definition of the button connected to pin 2 and GND
pinMode (2, INPUT_PULLUP);
//We initialize the serial channel
mySeria1.begin(9600);
// initialize the player
DFPlayer1.begin(mySeria1);
//Default volume at 15
DFPlayer1.volume(15); //Set volume value (0~30).
}
void loop() {
if (digitalRead (2) == LOW) {
DFPlayer1.play(1);
}
delay (250);// small delay for the players to march
// BUSY on LOW = Dplayer playing.
while (digitalRead (11) == LOW); //Code stopped here until finished playing.
}`
I think I have copied that correctly. Here is the code I want to implement a version of into the above:
My first question is that I get that this code will turn the relay on for three seconds then off for three seconds...or something like that. I don't need that. What I would like is for it to come on and then go off when BUSY pin on the dfplayer signals that it is done. I believe that portion of the code in the previous code will serve in this function. Am I correct? If I am, how I do tell it to just come on and wait? Second, Where do I put this code inside the other code?
Thanks again, I have really been learning a lot from this community.