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() {
}