![]() Serial.println(F("2. Serial.println(F("1.Please recheck the connection!")) Use softwareSerial to communicate with MP3 Serial.println(F("Initializing DFPlayer.")) Void printDetail(uint8_t type, int value) Special thanks to all who helped as well: Thanks for all the help! Figured it out: /*Software from Mert Arudino: Serial.println("Playing track 1 for 5 sec") SoftwareSerial mySerial(10, 11) // RX, TX Yes, when I tested the new example program this the message I got.Īnd an error message for the other library. And YES I have the 1k ohm connected to the RX pin of the MP3 player. No, I am not all of the digital I/O pins for other sensors/actuator, I just chose to follow the circuit diagram, although, I did change the RX and TX pin to be 10 and 11 and that seemed to work just fine, even though I still get a strange buzzing noise. I don't how to use the library without the SoftwareSerial library. I changed to that library you are talking about and the example worked, it's just I don't know how to use the library without the SoftwareSerial library, but I still put the library in my code. Just in case you can't see the schematic: Here is my schematic (I am powering the DFPlayer from a different 5V power source and the Arduino Mega 2560 is powered through a USB, also, why does the speaker make a weird noise every time I play a sound?): I tried looking for tutorials and couldn't find any tutorials on how to use the Arduino Mega 2560 with the DFPlayer Mini. Int ledPin = 13 // LED on Pin 13 of Arduino Int pirValue // Place to store read PIR Value Static void OnPlayFinished(uint16_t globalTrack) calling mp3.loop() periodically allows for notifications Mp3.playRandomTrackFromAll() // random of all folders on sd Uint16_t count = mp3.getTotalTrackCount() show some properties and set the volume SoftwareSerial secondarySerial(10, 11) // RX, TX comment out the above definition and uncomment these lines Specs of the ESP-01: Specs of the Mega: And as more FYI, here is the wiring diagram I refer to when Im integrating one into my projects. But the Mega2560 has a limit of 50mA on the 3.3v pin. Some arduino boards only have one hardware serial port, so a software serial port is needed instead. FYI: The ESP8266 can pull up to 300mA, although somewhere around 60 - 200 is more likely. defined with the above notification class and the hardware serial class Static void OnCardInserted(uint16_t code) Static void OnPlayFinished(uint16_t track) it expects the sd card to contain some mp3 files On the opposite side of the spectrum, the Arduino Mega 2560 board dimensions are about 4 x 2.1, making it about 6x bigger than the Micro in terms of area size. I'm talking about this example (PlayRandom): // this example will play a random track from all on the sd The Micro comes in, being true to its name, at 0.7 x 1.9 making it one of the smallest microcontroller boards out there. I tried using this library.Īnd that seemed to work for only one example, though. Hello! I am just wondering, "How do I connect and code the DFPlayer Mini to play a sound with an Arduino Mega 2560?" May someone, please, tell me how to do this? My attempt with someone's wiring diagram seemed to work in only some cases, and before you ask, YES, ground is connected from the Arduino Mega 2560 to the DFPlayer Mini.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |