Codey OnlineLibreria di componenti Arduino ed ESP32 › DF Player Mini
DF Player Mini
Sensori

DF Player Mini

Lettore MP3 DF Player Mini con lettore di schede TF

Larghezza: 44.8 mm

Pinout — DF Player Mini

Pin Segnale Descrizione
VCC power Top-left header pad, top pin
RX RX Left header pad, second pin from top
TX TX Left header pad, third pin from top
DAC_R analog Left header pad, fourth pin from top
DAC_I analog Left header pad, fifth pin from top
SPK_1 data Left header pad, sixth pin from top
GND ground Left header pad, seventh pin from top
SPK_2 data Left header pad, bottom pin
BUSY digital Top-right header pad, top pin
USB- data Right header pad, second pin from top
USB+ data Right header pad, third pin from top
ADKEY_2 analog Right header pad, fourth pin from top
ADKEY_1 analog Right header pad, fifth pin from top
IO_2 digital Right header pad, sixth pin from top
GND ground Left header pad, seventh pin from top
IO_1 digital Right header pad, bottom pin

Schema di cablaggio di esempio — DF Player Mini

Da A Filo
board:5V x1:VCC red
board:GND x1:GND black
board:D10 x1:RX green
board:D11 x1:TX blue

Codice Arduino di esempio — DF Player Mini

Questo esempio è stato scritto e verificato in compilazione per arduino-uno. Codey Online lo adatta a qualsiasi altra scheda supportata.

#include <SoftwareSerial.h>
#include <DFRobotDFPlayerMini.h>

SoftwareSerial dfSerial(10, 11); // Arduino RX, TX
DFRobotDFPlayerMini dfPlayer;

void setup() {
  Serial.begin(9600);
  dfSerial.begin(9600);

  Serial.println("Initializing DFPlayer Mini...");

  if (!dfPlayer.begin(dfSerial)) {
    Serial.println("DFPlayer Mini not detected. Check wiring and SD card.");
    while (true) {
      delay(1000);
    }
  }

  Serial.println("DFPlayer Mini ready.");
  dfPlayer.volume(20); // Range: 0 to 30

  // Play the first track on the microSD card.
  dfPlayer.play(1);
  Serial.println("Playing track 1.");
}

void loop() {
  // Nothing to do here for the basic example.
}

Componenti correlati

18650 Battery Shield with USB-C Charger and 5V Boost Converter

18650 Battery Shield with USB-C Charger and 5V Boost Converter

2.4 inch OLED Display I2C 3.3V

2.4 inch OLED Display I2C 3.3V

3.5 inch TFT LCD Shield

3.5 inch TFT LCD Shield

50kg Load Cell Weight Sensor

50kg Load Cell Weight Sensor

Crea il tuo progetto Arduino o ESP32 con l'AI

Descrivi cosa vuoi realizzare. Codey Online scrive il codice, disegna lo schema di collegamento, lo compila e programma la tua scheda direttamente dal browser.

Inizia gratis