I would like to know if it's possible to play audio from differtent arduino's to an audio board?
I'm trying to create some kind of escaperoom puzzlebox.
There are 6 puzzles and the all use an Arduino Uno. I cannot use a Arduino Mega, since it has not enough pins for all puzzles.
I wonder if it's possible to connect all Arduino's to a single DFplayer, but I'm not sure if it's going to work.
Does anybody tried this of maybe some other possibillity?
I had worked around this by connecting (in my case only two) the Arduinos via i2c using wire.h. Esentially, whenever an mp3 file was to be triggered, the number of the file was sent to the master arduino which then triggered a play event on the DFPlayer with the same filenumber. To save pins, you can probably daisychain the arduinos to forward the required number to the one that actually controls the DFPlayer.
You can have a look at my messy code here:
But, word of warning.. I'm no coder and it's been almost 4 years, I have little memory of what went into this.
Sure. Just poll the pins of the Arduino attached to the DFPlayer. Send a digitalWrite(HIGH); from one of the puzzle Arduinos to some pin on the DFPlayer where it polls if (puzzleOneTriggerPin == HIGH) // play the associated track
It kind of depends how you want to go about doing it, but the easiest method is probably a simple wired connection between digital pins controlling a DFPlayer.
If you want to go wireless, I wrote a library TMRpcm that is capable of broadcasting audio from SD card to any number of other devices running RF24Audio using NRF24L01 radios.