Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- #include <SoftwareSerial.h>
- #include <DFRobotDFPlayerMini.h>
- const int baudRate = 9600;
- SoftwareSerial mySoftwareSerial(6, 8); // RX, TX
- DFRobotDFPlayerMini myDFPlayer;
- void setup() {
- mySoftwareSerial.begin(baudRate);
- Serial.begin(baudRate);
- if (!myDFPlayer.begin(mySoftwareSerial)) { //Use softwareSerial to communicate with mp3.
- Serial.println("Issue starting DFplayer");
- while(true);
- } else {
- Serial.println("DFPlayer Mini online.");
- }
- }
- void loop() {
- //do more stuff
- }
Add Comment
Please, Sign In to add comment