![]() ![]() 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. 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. Int ledPin = 13 // LED on Pin 13 of Arduino 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. 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 compared to other maker boards by Arduino. comment out the above definition and uncomment these lines Arduino® Mega 2560 is an exemplary development board dedicated for building extensive applications as. Some arduino boards only have one hardware serial port, so a software serial port is needed instead. 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 I'm talking about this example (PlayRandom): // this example will play a random track from all on the sd 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 |