Guest User

Untitled

a guest
Nov 25th, 2017
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include <SoftwareSerial.h>
  2. #include <DFRobotDFPlayerMini.h>
  3.  
  4. const int baudRate = 9600;
  5.  
  6. SoftwareSerial mySoftwareSerial(6, 8); // RX, TX
  7. DFRobotDFPlayerMini myDFPlayer;
  8.  
  9. void setup() {
  10.  
  11.   mySoftwareSerial.begin(baudRate);
  12.   Serial.begin(baudRate);
  13.  
  14.   if (!myDFPlayer.begin(mySoftwareSerial)) {  //Use softwareSerial to communicate with mp3.
  15.     Serial.println("Issue starting DFplayer");
  16.     while(true);
  17.   } else {
  18.     Serial.println("DFPlayer Mini online.");
  19.   }
  20.  
  21.  
  22. }
  23.  
  24. void loop() {
  25.  
  26. //do more stuff
  27.  
  28. }
Add Comment
Please, Sign In to add comment