Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP32 Support #59

Open
ConnalM opened this issue Feb 25, 2024 · 3 comments
Open

ESP32 Support #59

ConnalM opened this issue Feb 25, 2024 · 3 comments

Comments

@ConnalM
Copy link

ConnalM commented Feb 25, 2024

Hi,

I'm looking to use your library to connect an ESP32 to a DY-SV5W or similar but when I use the Arduino header file, I hear nothing and, when I use the library for the ESP32, I get an error:

error: no matching function for call to 'DY::Player::Player()' DY::Player player;

Any suggestions?

Thanks,

Connal

@alastaira
Copy link

ESP32 works fine for me, prorgammed using Arduino IDE.

@darrenjcosborne
Copy link

@alastaira Can you please share your working code?

@alastaira
Copy link

It's basically exactly the same as in the examples. Relevant lines as follows:

// INCLUDES
// Used to create serial interface to DY-HV20T (DY-SV8F/DY-SV5W/similar)
// See https://github.com/SnijderC/dyplayer
#include "src/DYPlayerArduino.h"

// GLOBALS
// An object to address the audio player
DY::Player player(&Serial2);

void setup() {
  // Initialise secondary serial interface to audio module
  Serial.println(F("Configuring audio interface"));
  Serial2.begin(9600, SERIAL_8N1, 16, 17);
  player.begin();
  player.setCycleMode(DY::PlayMode::OneOff);
  // Volume is a value from 0-30
  player.setVolume(30);
}

void loop() {
  player.playSpecified(2);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants