Go Down

Topic: wtv020SD-16P Play file 1, when song is over play file 14(no delays) (Read 45 times) previous topic - next topic


I am having a hard time getting my home made mp3 player to work correctly. Is it possible to have one song play, then another (that isn't the number that was just played+1) to automatically play when the song is finished? I want to do this without having to manually put in how long each song last using the delay function. I've tried using the busy pin to figure out if a song is playing, but i'm having a hard time figuring it out.

Here is my code, can anyone lead me in the right direction?

Code: [Select]
 Example: Control a WTV020-SD-16P module to play voices from an Arduino board.
 Created by Diego J. Arevalo, August 6th, 2012.
 Released into the public domain.

#include <Wtv020sd16p.h>

int resetPin = 4;  // The pin number of the reset pin.
int clockPin = 5;  // The pin number of the clock pin.
int dataPin = 6;  // The pin number of the data pin.
int busyPin = 7;  // The pin number of the busy pin.
boolean onlyOnce=HIGH;
Create an instance of the Wtv020sd16p class.
 1st parameter: Reset pin number.
 2nd parameter: Clock pin number.
 3rd parameter: Data pin number.
 4th parameter: Busy pin number.
Wtv020sd16p wtv020sd16p(resetPin,clockPin,dataPin,busyPin);

void setup() {
  //Initializes the module.

void loop() { while (digitalRead(busyPin==LOW))
if (digitalRead(busyPin)==LOW){Serial.print("reset pin is ");
    Serial.print("clockPin is ");
    Serial.print("dataPin is ");
    Serial.print("busyPin is ");
    //if (onlyOnce==HIGH)

void yapizza(){
  //Plays synchronously an audio file. Busy pin is used for this method.
  //Plays asynchronously an audio file.
  //Plays audio file number 1 during 2 seconds.
  //Stops current audio file playing.
  //Plays synchronously an audio file. Busy pin is used for this method. 
  //Mutes audio file number 2 during 2 seconds.   
  //Stops current audio file playing.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131