/*******************************************
*******************************************
***
REPRODUCTOR DF PLAYER ***
***
Ing. Brain Naser Soto
***
***
***
***
WWW.NASER.CL ***
*******************************************
******************************************/
//#include "Arduino.h"
#include "SoftwareSerial.h"
#include "DFRobotDFPlayerMini.h"
SoftwareSerial mySoftwareSerial(10,11); // (Tx, Rx)
DFRobotDFPlayerMini myDFPlayer;
int mensaje=1;
void setup()
{
pinMode (2, INPUT); // Switch
pinMode (12, INPUT); // Busy
mySoftwareSerial.begin(9600);
myDFPlayer.begin(mySoftwareSerial);
myDFPlayer.volume(20); //Volumen de 0 a 30
myDFPlayer.play(0006);
delay (500);
}
void loop() {
boolean busy = digitalRead (3); // lee estado de Busy
boolean sw = digitalRead (2); // lee estadop del Switch
if (sw == LOW){
myDFPlayer.play(mensaje);
mensaje++;
}
delay (500);
if (mensaje>5){
mensaje=1;
}
}
|