Hi - Just as a fyi there is an inconsistency in your information guide for this product regarding pin 6 and 8 as it relates to spk1 and spk2. Currently investigating which pin actu...
JaneYu 2015-11-13 09:09:06 44 Views99 Replies Hi - Just as a fyi there is an inconsistency in your information guide for this product regarding pin 6 and 8 as it relates to spk1 and spk2. Currently investigating which pin actually goes to positive and negative on our breadboard.
May I ask if the audio panning you are referring to is the left and right channels? You can do this by plugging your speakers into DAC_L as well as DAC_R.
JaneYu what is the function that is used to play the next song once the previous song is completed
JaneYu You could try the "enableLoopAll()" to see if it works.
Here are some suggestions to resolve this issue:
1.Run the Arduino IDE as an administrator: Right-click on the Arduino IDE shortcut and select "Run as administrator." This will grant the Arduino IDE higher permissions, which may resolve the insufficient permission issue.
2.Check the permissions for the library files and folder: Right-click on the DFRobotDFPlayerMini library folder (located in c:\Users\dcaru\Documents\Arduino\libraries\) and select "Properties," then click on the "Security" tab. Ensure that your user account has read and write permissions for the folder and its contents. If not, modify the permissions accordingly.
JaneYu Problem solved:
the DFPlayer library from DFRobot <dfrobotdfplayermini.h> supports only SoftwareSerial.
The library from Makuna <dfminimp3.h> supports HardwareSerial & SoftwareSerial
https://github.com/Makuna/D...
with that exaple i can use the DFPlayer with normal RX & TX Pins, without SoftwareSerial.h
And i found a really good german website, that explains how to start with DFPlayer Mini and how to connect: https://www.elektronik-komp...
JaneYu Hello
I have dfplayer and i have some problem, i want To use 10 button for playing 10 songs, I'm using Arduino. Can you help me
JaneYu Can this module play two songs at the same time?
This module is amazing I've been playing with it for a while now and I have no problem with it whatsoever. However, I was wondering if there is a way I could play two songs at the same time or playing the next song while the current song is still playing...?
JaneYu Hi, This is a product customization, please contact us via email: [email protected]
JaneYu I'd like to learn more about how to use this project with a micro:bit. All of the examples I've found online are quite old - are they the most up-to-date info? https://github.com/lioujj/p... is the example I found. Can you point me towards so more recent info?
JaneYu Hi, Sorry we don't have an updated tutorial at the moment, or you can try using our Mind + software, which also has the DFPlayer block module;
https://mindplus.cc/downloa...
Good morning. I have problems Arduino with servomotors and a sound with DFplayer mini. I build the CZ crossing railway. Please you look where do I get an error or missing codes?
Please you do, fix and send e-mail me in gmail.com ([email protected])?
Program:
#define GATE_SPEED1 20
#define GATE_SPEED2 20
#define GATE_DOWN1 90
#define GATE_DOWN2 90
#define GATE_UP1 0
#define GATE_UP2 0
#define SERVO_PIN1 9
#define SERVO_PIN2 10
#define RELE_PIN 3
#include <softwareserial.h>
#include <dfrobotdfplayermini.h>
// Use pins 2 and 3 to communicate with DFPlayer Mini
static const uint8_t PIN_MP3_TX = 4; // Connects to module's RX
static const uint8_t PIN_MP3_RX = 8; // Connects to module's TX
SoftwareSerial softwareSerial(PIN_MP3_RX, PIN_MP3_TX);
// Create the Player object
DFRobotDFPlayerMini player;
unsigned long currentMillZVUK;
unsigned long previousMillZVUK = 0;
unsigned long intervalZopakovatzvuk = 1110;
const int buttonPin = 2;
int zpozdeni = 0;
int buttonPushCounter = 1; // počítadlo stlačení tlačítka
int buttonState = 0; // současný stav tlačítka
int lastButtonState = 0; // předchozí stav tlačítka
unsigned long currentMillis1;
unsigned long previousMillis1 = 0;
unsigned long currentMillis2;
unsigned long previousMillis2 = 0;
unsigned long intervalDownServo1 = 5000;
unsigned long intervalUpServo1 = 5000;
unsigned long intervalDownServo2 = 5000;
unsigned long intervalUpServo2 = 5000;
#include <servo.h>
Servo gate_servo1;
Servo gate_servo2;
byte angle1 = GATE_UP1;
byte angle2 = GATE_UP2;
byte setpoint1 = GATE_UP1;
byte setpoint2 = GATE_UP2;
unsigned long time_for_servo1;
unsigned long time_for_servo2;
void setup() {
pinMode(buttonPin, INPUT);
gate_servo1.attach(SERVO_PIN1);
gate_servo2.attach(SERVO_PIN2);
Serial.begin(9600);
pinMode(RELE_PIN, OUTPUT);
softwareSerial.begin(9600);if (player.begin(softwareSerial)) {
Serial.println("OK");
// Set volume to maximum (0 to 50).
player.volume(50);
// Play the first MP3 file on the SD card
//player.play(1);
} else {
Serial.println("Automaticky s DFPlayer Mini a ledky startují.");
}
}
void loop(){
// přečtěte vstupní pin tlačítka:
buttonState = digitalRead(buttonPin);
// porovnejte buttonState (stav tlačítka) s předchozím stavem
if (buttonState != lastButtonState) {
// jestliže se stav změnil, navyšte hodnotu počítadla
if (buttonState == HIGH) {
// jestliže je současný stav HIGH, tlačítko přešlo
//z off na on:
buttonPushCounter++;
Serial.println("on");
Serial.print("number of button pushes: ");
Serial.println(buttonPushCounter);
}
else {
// jestliže je současný stav LOW, tlačítko přešlo
// z on na off:
Serial.println("off");
}
}
lastButtonState = buttonState;
if ((buttonPushCounter % 2 == 0)) {
//&&(buttonPushCounter != 0)
GateServoDOWN_1(9);
GateServoDOWN_2(10);
digitalWrite(RELE_PIN, HIGH);
ZVUK(4,8);
}
else{
GateServoUP_1(9);
GateServoUP_2(10);
digitalWrite(RELE_PIN, LOW);
}
}
void GateServoDOWN_1(int pin){
currentMillis1 = millis();
if(currentMillis1 - previousMillis1 > intervalDownServo1) {
previousMillis1 = currentMillis1;
setpoint1 = GATE_DOWN1;
}
if (millis() > time_for_servo1){
time_for_servo1 = millis() + GATE_SPEED1;
if (angle1 < setpoint1) angle1++;
gate_servo1.write(angle1);
Serial.print(setpoint1);
Serial.print(" ");
Serial.println(angle1);
}
}
void GateServoDOWN_2(int pin){
currentMillis2 = millis();
if(currentMillis2 - previousMillis2 > intervalDownServo2) {
previousMillis2 = currentMillis2;
setpoint2 = GATE_DOWN2;
}
if (millis() > time_for_servo2){
time_for_servo2 = millis() + GATE_SPEED2;
if (angle2 < setpoint2) angle2++;
gate_servo2.write(angle2);
Serial.print(setpoint2);
Serial.print(" ");
Serial.println(angle2);
}
}
void GateServoUP_1(int pin){
currentMillis1 = millis();
if(currentMillis1 - previousMillis1 > intervalUpServo1) {
previousMillis1 = currentMillis1;
setpoint1 = GATE_UP1;
}
if (millis() > time_for_servo1){
time_for_servo1 = millis() + GATE_SPEED1;
if (angle1 > setpoint1) angle1--;
gate_servo1.write(angle1);
Serial.print(setpoint1);
Serial.print(" ");
Serial.println(angle1);
}
}
void GateServoUP_2(int pin){
currentMillis2 = millis();
if(currentMillis2 - previousMillis2 > intervalUpServo2) {
previousMillis2 = currentMillis2;
setpoint2 = GATE_UP2;
}
if (millis() > time_for_servo2){
time_for_servo2 = millis() + GATE_SPEED2;
if (angle2 > setpoint2) angle2--;
gate_servo2.write(angle2);
Serial.print(setpoint2);
Serial.print(" ");
Serial.println(angle2);
}
}
void ZVUK (int pin1, int pin2){
// přečtěte vstupní pin tlačítka:
buttonState = digitalRead(buttonPin);
// porovnejte buttonState (stav tlačítka) s předchozím stavem
if (buttonState != lastButtonState) {
// jestliže se stav změnil, navyšte hodnotu počítadla
if (buttonState == HIGH) {
// jestliže je současný stav HIGH, tlačítko přešlo
//z off na on:
buttonPushCounter++;
Serial.println("on");
Serial.print("number of button pushes: ");
Serial.println(buttonPushCounter);
}
else {
// jestliže je současný stav LOW, tlačítko přešlo
// z on na off:
Serial.println("off");
}
}
// uložte současný stav jako „poslední stav“,
//abyste ho mohli v příští smyčce použít
lastButtonState = buttonState;
// zapne LED po každých čtyřech stlačeních
// použitím modula počítadla.
// funkce modulo vám vrátí zbytek
// z dělení dvou čísel:
if ((buttonPushCounter % 2 == 0)) {
currentMillZVUK = millis();
if(currentMillZVUK - previousMillZVUK > intervalZopakovatzvuk) {
previousMillZVUK = currentMillZVUK;
zpozdeni ++;
// Start communication with DFPlayer Mini
player.play(1);
}
}
}
Sincerely Pepa Kamiš
JaneYu For anyone interested there is some very good info on the DFPlayer over at Cahamo's Electronic Adventures (https://cahamo.github.io/re.... Someone back in 2015 did a lot of research and testing and made the info available to everyone. The original post was removed, but has been re-posted.
JaneYu Hi, I'm trying to conect by DAC pins to an amplifier, but I have a lot of interference when sound is playing, I try connecting some filters in line, but always ear an interference sound. How can solve? Thanks so much.
JaneYu Whether the noise will be generated at the moment of power-on or continuously, if the latter, please send an email to [email protected]
What is the output impedence of the speker out 4Ohm or 8Ohm?
JaneYu I finally found the answer, [Project 5 video] showed briefly the speaker connected, and on the back is written 2 W and 8 Ohm. Funny because the watts he explained backwards. You don't throw on a speaker that doesn't even handle as much watts as the maximum (3 Watt) output of the MP3 player but he didn't mention the important factor would be speaker impedance which now I've found two references that said 8 Ohm minimum (except one said max so I wish people would understand Ohm's law before trying to give a lecture.
Greetings!
I am getting a Com error code 129 when running the example code. Is there a list co com error codes somewhere? What does Com error 129 mean?
Thanks in advance!
Have a better day!
JaneYu Hi Sean,
Are you using Linux? You need to allow permission for the com port you are using.
Hi, I was trying to get the status of the player using readState() but it comes back with number that are not listed anywhere. Do you have a list of "numbers" this function will give back?
JaneYu Hi Mike,
For this you can use the DAC_L and DAC_R output.
They are the same voltage as line-in.
Do not use the speaker output! The amplifier is a D-class switching amplifier, that will continuously switch between 0 and 3.3 volt.
JaneYu Hi Tmpmai,
That is actually easy... DFPlayer can be stopped, or also 'paused', if you send the '0x0E' command, the player will pause playing. When you query the current status (call 0x42), it will tell you it is 'paused' (in stead of stopped).
Calling play again (0x0D) will resume where you paused the music.
You can read about this in detail in the specs from Flyron:
http://www.trainelectronics...
One important catch: there is an old version and new version of the DFPlayer, and you have to look at the microprocessor on the bottom of the module.
"yx5200" is the new chip that has these possibilities. The "aa19hf8328" doesn't... a lot of chineese vendors still sell the old version of the module. (or a clone with the old chip maybe).
That is... if you keep the module powered on... if you power off and then want to restart on powering on... there is no hope :-7
JaneYu Hi, how can I change the volume of the left or right channel ? I only see code to change both at the same time.
JaneYu Hello what is the recommended speaker impedance 4ohm or 8ohm with 3Watt and 2 watt speakers?
JaneYu Hello. Is it possible to use the DFPlayer to store code of an arduino proyect (for example animations of a led matrix). Didn`t find something like that on the web and some friends told me it may not be possible, well here am I asking if some one has done something like that or if there is some possible way to do it. Appreciate help or guidance.
Thanks!
JaneYu Sorry for late, could you give me the video about the test, it will help me make sure the problem.Thanks.
If there is any problem, we will exchange the produce. This is our email: [email protected]
JaneYu I was able to figure out the problem. I had a pull up resistor on the AD1 input since I was driving the input with a FET. Removing that resistor solved all the problems, including the strange operation of the IO1 inputs. thank you for your help.


