Compile error BY8X01

I am trying to get an BY8001-module (MP3/WAV-player) running.

For this scope I am using library file BY8X01-16P.h

When I try to compile the example sketch SimpleExample (part of the library, see under) I' am getting an error (see attachment).

Question: how to solve this?

Hardware used: Arduino Uno
Further: the resistors A an C of the module have been removed.

// BY8X01-16P-Arduino Simple Example

#include "BY8X01-16P.h"
//#define HAVE_HWSERIAL1
#define LFSR_INIT 0xfeedfaceUL

BY8X0116P audioController; // Library using default Serial1 UART and no busy pin hookup

void setup() {
Serial1.begin(9600); // Serial1 must be started first - only supported UART baud rate is 9600

audioController.init(); // Initializes module

audioController.setVolume(20); // Sets player volume to 20 (out of 30 max)

audioController.play(); // Starts playback of loaded tracks
}

void loop() {
}

Error.txt (1.13 KB)

Please use code tags when you post code or warning/error messages. To do this, click the </> button on the forum toolbar, then paste the text you want to be in the code tags. Finally, move the cursor out of the code tags before adding any additional text you don't want to be in the code tags. If your browser doesn't show the posting toolbar, then you can manually add the code tags like this:
[code]``[color=blue]// your code is here[/color]``[/code]

The reason for doing this is that, without code tags, the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier for us to read your code and to copy it to the IDE or editor.

Using code tags and other important information is explained in the "How to use this forum" post. Please read it.

You're much more likely to get help here if you post the error messages directly to the forum, rather than as an attachment. If you had done so in this case, I guarantee someone would have already given you the solution to your problem. In the event that the text you need to post exceeds the forum's 9000 character limit, it's OK to use an attachment. However, in this case you were nowhere near 9000 characters.

jandkr's error:

Arduino: 1.6.8 (Windows 7), Board:"Arduino/Genuino Uno"

In file included from C:\Users\JanP\Documents\Arduino\BY8X01-16P-Arduino-master\examples\SimpleExample\SimpleExample.ino:3:0:

BY8X01-16P.h:103: error: 'Serial1' was not declared in this scope

     BY8X0116P(Stream& stream = Serial1, byte busyPin = 0, byte busyActiveOn = HIGH);

                                ^

SimpleExample:7: error: call to 'BY8X0116P::BY8X0116P(Stream&, byte, byte)' uses the default argument for parameter 1, which is not yet defined

 BY8X0116P audioController;          // Library using default Serial1 UART and no busy pin hookup

           ^

C:\Users\JanP\Documents\Arduino\BY8X01-16P-Arduino-master\examples\SimpleExample\SimpleExample.ino: In function 'void setup()':

SimpleExample:10: error: 'Serial1' was not declared in this scope

     Serial1.begin(9600);            // Serial1 must be started first - only supported UART baud rate is 9600

     ^

exit status 1
'Serial1' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

The problem is that the code you're using was written for an Arduino board with an extra serial port, named Serial1 (e.g. Mega, Leonardo, Micro) but you're using an Uno, which only has the one serial port, named Serial. You'll need to create a software serial port by using a library like SoftwareSerial and then update your code accordingly. You'll see how to do this by reading the library documentation:

I had no idea what was wrong, but now it is clear.

Thanks for your answer and comment.

I have added 2 statements (include library SoftwareSerial.h and creation of an instance of it).
But now I am getting other error messages. How should I solve this?

Arduino: 1.6.8 (Windows 7), Board:"Arduino/Genuino Uno"

SimpleExample:11: error: no matching function for call to 'BY8X0116P::BY8X0116P()'

 BY8X0116P audioController;          // Library using default Serial1 UART and no busy pin hookup

           ^

In file included from C:\Users\JanP\Documents\Arduino\BY8X01-16P-Arduino-master\examples\SimpleExample\SimpleExample.ino:3:0:

sketch\BY8X01-16P.h:105:5: note: candidate: BY8X0116P::BY8X0116P(Stream&, byte, byte)

     BY8X0116P(Stream& stream, byte busyPin = 0, byte busyActiveOn = HIGH);

     ^

sketch\BY8X01-16P.h:105:5: note:   candidate expects 3 arguments, 0 provided

sketch\BY8X01-16P.h:96:7: note: candidate: constexpr BY8X0116P::BY8X0116P(const BY8X0116P&)

 class BY8X0116P {

       ^

sketch\BY8X01-16P.h:96:7: note:   candidate expects 1 argument, 0 provided

sketch\BY8X01-16P.h:96:7: note: candidate: constexpr BY8X0116P::BY8X0116P(BY8X0116P&&)

sketch\BY8X01-16P.h:96:7: note:   candidate expects 1 argument, 0 provided

exit status 1
no matching function for call to 'BY8X0116P::BY8X0116P()'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
// BY8X01-16P-Arduino Simple Example

#include "BY8X01-16P.h"

//extra by JdK:
#include <SoftwareSerial.h>
//#define HAVE_HWSERIAL1
SoftwareSerial Serial1(10, 11); // RX, TX

//creeer een instance van de klasse BY8X0116P met naam audioController.
BY8X0116P audioController;          // Library using default Serial1 UART and no busy pin hookup

void setup() {
    Serial1.begin(9600);            // Serial1 must be started first - only supported UART baud rate is 9600

    audioController.init();         // Initializes module

    audioController.setVolume(20);  // Sets player volume to 20 (out of 30 max)

    audioController.play();         // Starts playback of loaded tracks
}

void loop() {
}

The answer is right there is your comment on this line:

BY8X0116P audioController;          // Library using default Serial1 UART and no busy pin hookup

You stated that you understood that your Uno doesn't have a 'Serial1' port, so you obviously can't use this version of the constructor.

The error message also makes some suggestions for the proper constructor version to use. This one looks the most promising:

sketch\BY8X01-16P.h:105:5: note: candidate: BY8X0116P::BY8X0116P(Stream&, byte, byte)

     BY8X0116P(Stream& stream, byte busyPin = 0, byte busyActiveOn = HIGH);

since you need to tell it you're using an instance of SoftwareSerial Stream. You have to look in the library's source code (or if you're lucky the documentation) to figure out what the other arguments are and if you need to supply them.

I just changed library usage: instead of using BY8X01 I started using library BY8001.
The result is:
mp3-files are played in the correct way, but wav-files (WAV extension and RIFF header) are not!

The wav-files are detected (using mp3.nextTrack(), followed by mp3.getFileNameCurrentTrack),
no error message appears, but 'playback duration' (getTotalTrackPlaybackTime) is always zero.

As I want to play uncompressed files it is important to get WAV-files playing too.
Note:
the WAV-files used are played without any problem in Windows Media-player .

My question now is:
did anybody get WAV-files being played on the BY8001 module and how/what was different?

I posed the question mentioned above in the forum Audio (I think that forum is more appropiate).

Here's jandkr's new thread for the runtime issue:
http://forum.arduino.cc/index.php?topic=606202