Vous êtes sur la page 1sur 1

if ((analogRead(A0) > thresh) && !(MP3player.

isPlaying()) ) // if button press


ed and file is not playing
{
uint8_t result = MP3player.playMP3("track001.mp3"); // Play the file
playFlag = 1; // set the playflag to 1
}
// If button is pressed and file is playing, do nothing:
else if ((analogRead(A0) > thresh) && (MP3player.isPlaying()) )
{
Serial.println("playing");
}
else {
if (playFlag) { // if file is playing, stop it and set the playflag to 0
MP3player.stopTrack();
playFlag = 0;
}
}

Vous aimerez peut-être aussi