Open sbarabe opened 4 months ago
Ok here is how I solve my problem. The only thig I'm not sure is if the constructor with no argument ( Player_DY::Player_DY() : _player(){};
) really works and if it is initiating a DYPlayer with hardware serial ?
`
#include <Arduino.h>
#include <DYPlayerArduino.h>
#include <SoftwareSerial.h>
SoftwareSerial serial(4, 5);
class Player_DY
{
private:
DY::Player _player;
public:
Player_DY::Player_DY(SoftwareSerial &serial) : _player(&serial){};
Player_DY::Player_DY(HardwareSerial &serial) : _player(&serial){};
Player_DY::Player_DY() : _player(){};
void begin()
{
_player.begin();
}
};
Player_DY playerSW(serial);
Player_DY playerHW(Serial1);
Player_DY player;
void setup()
{
player.begin();
playerSW.begin();
playerHW.begin();
}
void loop()
{ }
`
Hi, in an arduino sketch on Platformio, I'm trying to create an instance of the DYPlayer in an ohter instance.
I am using Nano Every and the DYPlayerArduino.h
Exemple:
Then in the main sketch I'm using:
ou
but I keep having those messages at compile:
Do you think it's possible to fix this ? Thank you !