Go Down

Topic: Soundboard With Keypad no file (Read 3727 times) previous topic - next topic

jaredm2195

do I have to solder the wires together. on this photo I don't know.
https://www.dfrobot.com/wiki/index.php/File:PlayerMini.png

CrossRoads

Yes, some soldering will likely be needed.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

jaredm2195

I'm going to do the project sometime in march and I will update the status on how I am doing with the project and if I need help with certain things.

jaredm2195

What pieces will I need to solder together when I put the pieces together. I have the keypad 3 by 4 matrix and the Arduino and the sound mp3 module. I have the arduino starter kit. I don't know what pieces need to go together and I need a schematic to do it because my Grandpa will help me with it when he comes to my house. I want the code to work before i solder the pieces together so I don't have to un-solder it and redo the code and then solder it back again. Can someone try this before I do and also with the code so when I build/solder it, It will work right.

jaredm2195



xl97

So lets re-cap...  since your information providing skills are a bit 'lacking.


1.) You have an .mp3/.wav player..  it is a DFPlayer board:
https://www.dfrobot.com/wiki/index.php/DFPlayer_Mini_SKU:DFR0299

* (purchased almost anywhere on the internet)..  DFRobot has a library for this.. ...although their 'support' forum sucks.....(there are also several variant libraries available.. not sure how current they are or any benefits from one over another)..

** That being said.. I have several batches of DFPlayers (different color leds)..  some WILL work with the most recent DFRobot library.. (and some do not)..  it seems like some DFPlayer boards may have some old firmware on it or something?  as it does no work with/respond to some of the newer query functions.. like readState() and a few others)

*** Side question: Does anyone know how to FLASH these?


Back on topic:

The DFPlayer board can be used with an Arduino or without an Arduino in standalone mode.. you just attach some buttons, and it will trigger the matching file on the SD card.

Another 'caveat' of the DFPlayer board is the required naming convention....
Depending on where you read up on this.. you have to name them as so:

0001.wav or .mp3
001.wav or .mp3

or even:

001_real-name.wav or .mp3  <-- (used so the names make a little more sense when reading it visually)

I believe the 'names' do not even matter... but they instruct you to use names like this.. so when the files or drag-n-dropped or copied to the SD card.. they will be written in the same numbered order.

The DFPlayer board ONLY CARES ABOUT THE ORDER THE FILES ARE COPIED TO THE SD CARD!  (read that again)..

So if I have a file named: xyz.wav and I copy that file to the SD card first... that file will ALWAYS be referenced to as 1.
as in myDFPlayer.play(1)...

IMHO... you should not use the 3x4 keypad matrix.. and just wire up some buttons (12)...and connect them directly to the Arduino board.. each one to its own pin.

Whip up some code that sets up 12 pins as inputs, connect the switches.. and check for which one is triggered.

After that you can add a line to play a matching .wav/.mp3 file when that button is pressed.

The default DFRobot library has a bunch of pre-defined functions for you to use as well

next()
previous()
loop()
play()
etc..  pretty sure enough for you to make your own 'mp3 player' with basic controls.


Set up your keypad (with code too)
http://www.circuitbasics.com/how-to-set-up-a-keypad-on-an-arduino/

Once you have the correct key outputting to the serial monitor..

Implement the DFPlayer:
* include library
* set-up
* call file to be played upon key press
https://www.dfrobot.com/wiki/index.php/DFPlayer_Mini_SKU:DFR0299

Thats it.




@jaredm2195

Your laziness is really pushing it!! LOL    (IMHO at least)..  So now you dont even want to test or try your own project?  You want us to test and debug it for you?  So in the end.. you have a working project?

With that stance (and attitude).. this is a PAID project.  In these parts of the forums.. we help you to help yourself!

jaredm2195

#22
Mar 30, 2018, 07:56 pm Last Edit: Mar 31, 2018, 08:48 pm by jaredm2195
I have the code where I push a button on the keypad and it tells me what button I hit on the serial monitor. now how do I change it to play audio from the sd card and how do I also add that if two buttons are playing at once it will play a random sound out of the two that were pressed and it would just pick a button sound to play from the two.

here is the code:

#include <Keypad.h>

const byte ROWS = 4;
const byte COLS = 3;

char hexaKeys[ROWS][COLS] = {
 {'1', '2', '3'},
 {'4', '5', '6'},
 {'7', '8', '9'},
 {'*', '0', '#'}

};
byte rowPins[ROWS] = {5, 6, 7, 8};
byte colPins[COLS] = {2, 3, 4};

Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);

void setup(){
 Serial.begin(9600);
}
 
void loop(){
 char customKey = customKeypad.getKey();
 
 if (customKey){
   Serial.println(customKey);
 }
}


Also, how do I make this creation onto a tutorial to show everyone how to make it I want to add the code and a schematic and image ( for an example, look below.) of the Arduino project on it's own?

xl97

Have you even looked at ANY of the DFPlayer examples?

Its not a very big library.. with only a handful of commands available..

I would think that once you look at it.. it will be clear on what you need to do..

ie:  myDFPlayer.play(3);

for example..


jaredm2195

#24
Apr 04, 2018, 03:33 am Last Edit: Apr 04, 2018, 03:35 am by jaredm2195
how do I add to the code to make the MP3 player, play audio from the sd card when I hit a specific button and the it will play a specific sound? How do I also add that if two buttons are playing at once it will play a random sound out of the two that were pressed and it would just pick a button sound to play from the two.

xl97

Have you even looked at ANY of the DFPlayer examples?

Its not a very big library.. with only a handful of commands available..

I would think that once you look at it.. it will be clear on what you need to do..

ie:  myDFPlayer.play(3);

for example..


https://www.dfrobot.com/wiki/index.php/DFPlayer_Mini_SKU:DFR0299

https://github.com/DFRobot/DFRobotDFPlayerMini/

https://github.com/DFRobot/DFRobotDFPlayerMini/archive/1.0.1.zip

jaredm2195

#26
Apr 06, 2018, 12:01 am Last Edit: Apr 06, 2018, 12:06 am by jaredm2195
@xl97

No, but I have a WTV020M01 which is a micro sd card MP3 player like the DFPlayer but it's different. Can someone help me combine the code for this MP3 player and the keypad code?

code here:

#include <Keypad.h>

const byte ROWS = 4;
const byte COLS = 3;

char hexaKeys[ROWS][COLS] = {
 {'1', '2', '3'},
 {'4', '5', '6'},
 {'7', '8', '9'},
 {'*', '0', '#'}

};
byte rowPins[ROWS] = {5, 6, 7, 8};
byte colPins[COLS] = {2, 3, 4};

Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);

void setup(){
 Serial.begin(9600);
}
 
void loop(){
 char customKey = customKeypad.getKey();
 
 if (customKey){
   Serial.println(customKey);
 }
}




Here is the link for the micro sd card MP3 player:

https://www.amazon.in/xcluma-U-Disk-Player-Module-Wtv020-Sd-16P/dp/B071LRV9LC/ref=sr_1_4?s=computers&ie=UTF8&qid=1522965520&sr=1-4&keywords=micro+sd+card+player+mp3

jaredm2195


Coding Badly


The answer is "probably".

But the vast majority of forum members expect you to make an attempt before they are willing to help.


jaredm2195

I need someone the help me combine the code for this MP3 player and the keypad code. How do I do this? I need help that's why I asked you!

Go Up