Go Down

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

DavidFMarks

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 !

Retroplayer

#46
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.

DavidFMarks

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 !!

DavidFMarks

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.


DavidFMarks

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

DavidFMarks

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
Code:
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 ;
Code:
   MP3.play(14);
   MP3.play(13);

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

leonardocr27

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  :)

Retroplayer

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

:::head-scratching:::

neverhart

You need to be logged in to see available downloads.

Go Up