But it doesn't work, doing only glitch sound.
I use some Serial.write in my program with the command number to select/play/stop a mp3 but only noise...like starting again and again the track...
Do you know:
-How to connect correctly this board (busy is to do what ?)
-Sending serial.write message is the right solution ?
this is my minimalist code:
int count;
void setup(){
count=0;
Serial.begin(4800);
}
void loop(){
Serial.write(239);//stop playing
if(count==0){
Serial.write(001);//play track number 1
count++;
}
}
Please don't "up" or "bump" unless you have something new to add. This discussion forum is used by people in nearly every time-zone around the planet. You need to be more patient. You also need to complete the profile so we know where you are, etc.
Yes i know, sorry, my personal definition is impatience but the time left so fast!
But that is exactly what your code tells it to do. So it looks like the board is working perfectly.
mmmm...i believe that my count passed from 0 to 1 and that's all... so the 001 track would play once time and stop.
When i try to do only :
if(count==0){
Serial.write(001);//play track number 1
count++;
}
in the loop, it's happen the same thing...
Busy is there so your code can see if the board is busy playing an MP3 or not. If you don't test that pin and wait for it, then you will play only the first tiny part of an MP3.
mmm...great thanks a lot for that tips !
This pin give me something like this:
1
1
ï0
ï0
ï1
0
ï0
ï0
ï1
.... when i read from a digital input.
I need to play my track when busy is on 0...?
Yes. But you are incrementing count, but only sending "001" over and over.
I changed my code to :
//So in terms of output Serial.print(val,BYTE) and Serial.write(val) are functionally identical.
int count = 0;
int busy = 4;
int val = 0;
void setup(){
Serial.begin(4800);
pinMode(busy, INPUT);
}
void loop(){
val = digitalRead(busy);
Serial.println(val);
delay(1000);
if(val==1){
delay(1000);
if(count==0){
Serial.write(001);//play track number 1
count++;
}
}
else{
Serial.write(239);//stop playing
}
Serial.print("count = ");
Serial.println(count);
delay(1000);
}
I'm using a classic duemilanove Arduino with atmega 328.
Ok, i think i'm using the same TX and RX for the mp3 player than for the USB port (pin number 0 and 1 on the Arduino).
So, i need to declare another serial port to talk to the mp3 device...?
May i need to use a library like NewSoftSerial to do that ?
something like this ? :
But my tiny mp3 board doesn't want to make any noise...
Where is the bug..?
The TX from the TDB380 (MP3 board) is connected to the pin 2 on the Arduino, and the RX from the TDB380 is coonnected to the pin 3 on the Arduino.
My TDB380 is running, the power led is brighting but not the busy led...mmm, where is the bug?
First off I would not issue the stop command as it looks like the device will execute all those commands right away so even if it started to Play it would Stop before you heard it.
also swap the TX and RX pins to make sure the terminology isn't getting you. It is really not clear from what perspective the terms RX and TX are defined. Swapping, even if wrong should not damage anything
I have used a VMUSIC2 module with the arduino which is somewhat similar, but was thinking of trying one of these as they are less expensive.