Advertisement
claudiusmarius

DFPlayerPROTestDFT01

Feb 25th, 2024
1,064
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.98 KB | None | 0 0
  1. #include <DFRobot_DF1201S.h>
  2. #include <SoftwareSerial.h>
  3. SoftwareSerial DF1201SSerial(2, 3);  //RX  TX
  4. DFRobot_DF1201S DF1201S;
  5.  
  6. void setup(void){
  7.     Serial.begin(115200);
  8.   DF1201SSerial.begin(115200);
  9.   while(!DF1201S.begin(DF1201SSerial)){
  10.     Serial.println("Init failed, please check the wire connection!");
  11.   delay(1000);
  12.   }
  13.   DF1201S.setVol(5);                         // Range 0 - 30
  14.     //Serial.print("VOL:");
  15.     //Serial.println(DF1201S.getVol());
  16.  
  17.   DF1201S.switchFunction(DF1201S.MUSIC);
  18.   delay(2000);
  19.  
  20.   DF1201S.setPlayMode(DF1201S.SINGLE);         // Sets PlayMode
  21.     Serial.print("PlayMode:");
  22.     Serial.println(DF1201S.getPlayMode());
  23.   DF1201S.setPrompt(false);                    // Silences Voice Prompt At Startup
  24.  
  25.  
  26.  
  27. }
  28.  
  29. void loop()
  30. {
  31.  
  32.   DF1201S.playSpecFile("/tow/for.mp3");                  //Contines
  33.   delay(2000);
  34.   DF1201S.playSpecFile("F/one/dos.mp3");                   // Chants d'oiseaux      
  35.   delay(5000);
  36.  
  37.  
  38. }
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement