I'm looking to play songs from a DF Player mini and for that I use the SoftwareSerial.h library but my code keeps compiling an error that it's not there. In addition, the error only appears when I use a nano 33 BLE card and not a standard nano one. I reinstalled Arduino IDE several times and even tried on another computer but nothing works
#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 = 6; // 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(30);
// Play the "0001.mp3" in the "mp3" folder on the SD card
player.playMp3Folder(1);
} else {
Serial.println("Connecting to DFPlayer Mini failed!");
}
}
void loop() {
}
-
what is your specific question? ... please add a focused, answerable question to your post ... do not write a question in a commentjsotola– jsotola2025年02月02日 16:13:53 +00:00Commented Feb 2 at 16:13
-
what research have you done? ... why did it not resolve your issue?jsotola– jsotola2025年02月02日 16:15:24 +00:00Commented Feb 2 at 16:15
-
the Nano 33 BLE has Serial1 on RX/TX pins. you can use it instead of SoftwareSerialJuraj– Juraj ♦2025年02月02日 20:54:55 +00:00Commented Feb 2 at 20:54
2 Answers 2
The SoftwareSerial library is provided by the Arduino cores on many types of boards. The Arduino Nano 33 BLE, however, uses the mbed version of the Arduino core, which lacks SoftwareSerial.
The Arduino Nano 33 BLE has an operating voltage of 3.3V. It is not 5V tolerant. To use DFPlayer Mini with Arduino Nano 33 BLE, you need a logic-level converter. You can make or buy one.
https://www.sparkfun.com/sparkfun-logic-level-converter-bi-directional.html
-
1The serial interface on the DFplayer mini is 3.3V even when powered by 5V.timemage– timemage2025年02月24日 16:04:00 +00:00Commented Feb 24 at 16:04
Explore related questions
See similar questions with these tags.