Go Down

Topic: Created a library for the MDFLY MP3 module (TDB380) (Read 22762 times) previous topic - next topic


Tried a 1k pullup with no success. Have now got schmitt trigger circuit for debounce. Tidied up the birds nest wiring and checked it out. The problem is still basically the same. I have tidied up the code which I attach (with the servo routine commented out). When I press the button this plays the specified file in full - no problem.. When I reintroduce the servo code, pressing the button starts the file playing OK and runs the first two or three servo operations (I put a delay in front to allow for the small start up delay playing the mp3) The file is then interrupted (before it has completed) and starts again from the beginning whilst the remaining servo commands execute. The four servos in circuit (I am not using the eyes in this test program) are powered from a separate battery pack with the ground tied back to grounds of the supplies for the arduino and the mp3 module. It's certainly a mystery and short of going up the village pub in search of inspiration I am at a loss what to try next --- think I'll go up the pub anyway !


Mar 07, 2013, 03:56 pm Last Edit: Mar 07, 2013, 03:59 pm by Retroplayer Reason: 1
Well, let's try to break it down a bit. You say that playback is interrupted before it is complete and then resumes from the beginning. This is a pretty big clue.

Is the MP3 you are playing the only one on the card?

BTW, when I am experiencing strange things like this, I insert status messages in my code to be printed out to the serial monitor that let me know what is going on inside the code such as what loops it is in, what functions were called, what the value of variables are, etc... I think this would be a good idea to do here. You could for example see that your call to playback is getting called multiple times, which would definitely help narrow things down.


There are about a dozen small files on the card. i will investigate your suggestion of using the serial output for debugging. Never tried that yet, but it sounds as if I need to learn !!


Stop Press !
I think I have solved the problem (without actually knowing why !) I just realised that, having set up the schmitt trigger I had forgotten to remove the code which was supposed to be debouncing.. Now I have removed it everything seems to be working... Now to try and make the eyes move at the same time.


very. I never could quite figure out the logic of that debounce code though


Back to the scarecrow after long break. Can't for some reson make it play a sequence of files if I wite the following short piece of code in after void setup it only plays file 14
n=14;                     // set number of file to be called
    Playfile(n);          //  then call it
    n = 13;               // change file number
    Playfile(n);          // play new file

similary if instead of using a functio I just use the play command direct like so ;

Then the same thing happens ! How the devil do I get it to play a sequence of files ..... must be doing something daft (again)


Hey people i need some help cause I already have the TDB380 from MDFLY but i cant make it work with arduino  :smiley-slim: I need some help to make it work also i knew that it work on 4800 and I read that someone here create a library for it but I cant find it so please help me I need your help people  :)


How can you not find the library when it is attached to the very first post in this thread?



You need to be logged in to see available downloads.


Was struggling to get Softwareserial to work and found this thread. Used your library. Worked like a charm. I've read that servos and softwareserial have trouble together. So far so good with this alternative.


excuse me, I want to ask
how the code calls and play the mp3 file that resides in the sd card, it is a condition of the output  reading of the sensor.
and please tell me the wiring from the circuit electronics TDB-380 to arduino.
Thank you


I have got the library running.  But no matter what I do, the module only plays the second file.  I am using the sample code.  I am using an Arduino Pro, not an UNO; does that make a difference?

Go Up