Bonjour à tous,
Je vous soumets ce code de fonctionnement du Df mini player sur une carte Arduino, il fonctionne normalement mais j'ai un problème de son quand la carte est alimentée, il est au maximum soit 30 pour le mini player juste 1 seconde puis passe au niveau indiqué dans le code soit 10,
Si vous avez une idée,
En vous remerciant,
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 // #include "SoftwareSerial.h" #include "DFRobotDFPlayerMini.h" // Use pins 2 and 3 to communicate with DFPlayer Mini static const uint8_t PIN_MP3_TX = 2; // Connects to module's RX static const uint8_t PIN_MP3_RX = 3; // Connects to module's TX SoftwareSerial softwareSerial(PIN_MP3_RX, PIN_MP3_TX); // Create the Player object DFRobotDFPlayerMini player; void setup() { // Init USB serial port for debugging Serial.begin(9600); // Init serial port for DFPlayer Mini softwareSerial.begin(9600); // Start communication with DFPlayer Mini if (player.begin(softwareSerial)) { Serial.println("OK"); // Set volume to maximum (0 to 30). player.volume(10); // Play the first MP3 file on the SD card player.play(1); } else { Serial.println("Connecting to DFPlayer Mini failed!"); } } void loop() { }
Partager