Quantcast
Channel: Arduino Forum - Latest topics
Viewing all articles
Browse latest Browse all 15544

MP3 player plays once but does not loop

$
0
0

For years I have successfully used mp3-tp-16p players. All of a sudden none of my sketches loop. It is very strange. I have tried using half a dozen different boards and several different sketches.
One song plays then the sketch stops just before the tune is to be played again in the following loop. The following just prints "Music plays" every 100 milliseconds.
I have been scratching my head for days and tempted to give up. Any tip on what I am doing wrong?

/// MP3
#include "Arduino.h"
#include "SoftwareSerial.h"
#include "DFRobotDFPlayerMini.h"
SoftwareSerial mySoftwareSerial(10, 11); // RX, TX10,11
DFRobotDFPlayerMini myDFPlayer;
void setup()
{
  Serial.begin(9600);
}
void loop()
{
  Serial.println("music plays");
  delay(100);
  myDFPlayer.volume(20);///set volume to 30
  myDFPlayer.play(001);
  delay(1000);
  Serial.println("music has been played");
  delay(100);
}

5 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 15544