SKU: OT4011 Αριθμός είδους: NA087 EAN: 8720618827739
Το DFPlayer Mini (clone) είναι ένα συμπαγές και ισχυρό module αναπαραγωγής MP3, ιδανικό για εφαρμογές ήχου σε έργα όπως Arduino ή άλλους μικροελεγκτές. Αυτό το module μπορεί να αναπαράγει απευθείας αρχεία MP3 από κάρτα microSD ή USB stick, χωρίς να απαιτείται επιπλέον υλικό.
Κύρια χαρακτηριστικά:
Το DFPlayer Mini είναι μια ευέλικτη λύση για όλα τα έργα σας που σχετίζονται με τον ήχο, είτε θέλετε να προσθέσετε ηχητικά εφέ στο σχέδιό σας είτε να δημιουργήσετε ένα ολοκληρωμένο ηχοσύστημα!
ΠΡΟΣΟΧΗ: Αυτό δεν είναι το αυθεντικό chip YX5200. Ο υπάρχων κώδικας για το chip YX5200 ενδέχεται να χρειαστεί προσαρμογή για τη σωστή λειτουργία.
Έτσι συνδέεις το DFPlayer Mini (clone) MP3 module με υποδοχή MicroSD σε ένα Arduino UNO ή ESP32, με ένα παράδειγμα sketch που μπορείς να ανεβάσεις αμέσως.
Αυτό το έργο δείχνει πώς να αναπαράγετε αρχεία ήχου MP3 χρησιμοποιώντας το module DFPlayer Mini και το Arduino Uno. Βεβαιωθείτε ότι η κάρτα microSD σας είναι διαμορφωμένη σε FAT32 και ότι ένα αρχείο MP3 βρίσκεται σε έναν φάκελο 'mp3' (ή στη ρίζα με όνομα 0001.mp3). Όταν τροφοδοτείται, το Arduino αρχικοποιεί τον player, ρυθμίζει την ένταση αναπαραγωγής και ξεκινά την αναπαραγωγή του πρώτου audio track.
/*
* ==================================================================
* Generated by Codey.online — https://www.codey.online
* ==================================================================
* Project : DFPlayer Mini MP3 Player Demo
* Board : Arduino UNO (arduino:avr:uno)
* Parts : DF Player Mini
* Libraries : DFRobotDFPlayerMini 1.0.6
*
* Codey Online is an AI-powered browser IDE for Arduino and ESP32.
* Describe your project and Codey writes the code, draws the wiring
* diagram and uploads it to your board, straight from the browser.
* This code is free to use, modify and share, without warranty.
* ==================================================================
*/
#include <SoftwareSerial.h>
#include <DFRobotDFPlayerMini.h>
// Arduino pin 10 connects to DFPlayer TX, pin 11 connects to DFPlayer RX
SoftwareSerial dfSerial(10, 11);
DFRobotDFPlayerMini myDFPlayer;
void setup() {
Serial.begin(115200);
dfSerial.begin(9600);
Serial.println(F("Initializing DFPlayer Mini..."));
if (!myDFPlayer.begin(dfSerial)) {
Serial.println(F("Unable to begin DFPlayer Mini:"));
Serial.println(F("1. Recheck wiring"));
Serial.println(F("2. Insert formatted micro SD card with MP3 files"));
while (true) {
delay(100);
}
}
Serial.println(F("DFPlayer Mini online."));
// Set volume (0 to 30)
myDFPlayer.volume(20);
// Play the first MP3 file on the micro SD card
myDFPlayer.play(1);
Serial.println(F("Playing track 1..."));
}
void loop() {
// Print status messages if received from the player
if (myDFPlayer.available()) {
uint8_t type = myDFPlayer.readType();
int value = myDFPlayer.read();
if (type == DFPlayerPlayFinished) {
Serial.print(F("Track finished: "));
Serial.println(value);
}
}
}
Απαραίτητες βιβλιοθήκες: DFRobotDFPlayerMini 1.0.6
Wiring diagram and example code generated by Codey.online — https://www.codey.online
Αυτό το έργο συνδέει ένα ESP32 με ένα DFPlayer Mini MP3 module για να αναπαράγει audio tracks από μια micro SD card μέσω ενός συνδεδεμένου speaker. Το DFPlayer Mini τροφοδοτείται από 3.3V, και το ESP32 επικοινωνεί μαζί του χρησιμοποιώντας hardware Serial2 στο GPIO 16 (RX2) και GPIO 17 (TX2). Διαμορφώστε τη micro SD card σας σε FAT32 και τοποθετήστε τα audio files σε έναν φάκελο 'mp3' (π.χ. 0001.mp3) για να ξεκινήσει η αναπαραγωγή.
/*
* ==================================================================
* Generated by Codey.online — https://www.codey.online
* ==================================================================
* Project : ESP32 DFPlayer Mini MP3 Player Demo
* Board : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
* Parts : DF Player Mini
* Libraries : DFRobotDFPlayerMini 1.0.6
*
* Codey Online is an AI-powered browser IDE for Arduino and ESP32.
* Describe your project and Codey writes the code, draws the wiring
* diagram and uploads it to your board, straight from the browser.
* This code is free to use, modify and share, without warranty.
* ==================================================================
*/
#include <DFRobotDFPlayerMini.h>
DFRobotDFPlayerMini myDFPlayer;
void setup() {
Serial.begin(115200);
// Serial2: RX on GPIO 16, TX on GPIO 17
Serial2.begin(9600, SERIAL_8N1, 16, 17);
Serial.println(F("Initializing DFPlayer Mini..."));
if (!myDFPlayer.begin(Serial2)) {
Serial.println(F("Unable to begin. Check SD card and wiring!"));
while (true) {
delay(500);
}
}
Serial.println(F("DFPlayer Mini online."));
myDFPlayer.volume(20); // Set volume (0 to 30)
myDFPlayer.play(1); // Play track 0001.mp3
}
void loop() {
// Play next track every 10 seconds
delay(10000);
Serial.println(F("Playing next track..."));
myDFPlayer.next();
}
Απαραίτητες βιβλιοθήκες: DFRobotDFPlayerMini 1.0.6
Wiring diagram and example code generated by Codey.online — https://www.codey.online