Pages: 1 2 3 [4]   Go Down
Author Topic: Created a library for the MDFLY MP3 module (TDB380)  (Read 7156 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 57
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
God Member
*****
Karma: 27
Posts: 829
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: March 07, 2013, 09:59:04 am by Retroplayer » Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 57
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Jr. Member
**
Karma: 0
Posts: 57
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
 
Logged

Offline Offline
God Member
*****
Karma: 27
Posts: 829
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

odd...
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 57
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Jr. Member
**
Karma: 0
Posts: 57
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley
Logged

Offline Offline
God Member
*****
Karma: 27
Posts: 829
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

:::head-scratching:::
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You need to be logged in to see available downloads.
Logged

Pages: 1 2 3 [4]   Go Up
Jump to: