Mp3. Mp3.begin(9600) // start mp3-communication Serial.begin(115200) // start serial interface This example code is in the public domain. Simple SerialMP3Player "Hello World" example of YX5300 chip.Ĭopy the "hello.mp3" file to an empty SD cardĬonnect the Serial MP3 Player to the Arduino boardĪfter compile and upload the code you must hear “Hello world” over and over. The speed won’t change as it is relatively slow to the device at 9600 bps, but there is one less library to take up code space and the reliability of the hardware will be will be higher." "Definitely use the hardware ports instead of SoftwareSerial. So as you said and from what i read on the comments of Marco C. If it helps, here's what the monitor display : The wire are correctly connected, the sd card as a folder name 01 with a mp3 file named 001xxx.mp3.ĭo you know anything on this issue ? It must be pretty common i think I did exactly what was required (or at least i think). Serial.print(Send_buf,HEX) //send bit to serial monitor in pc MySerial.write(Send_buf) //send bit to serial mp3 Send_buf = 0x00 //0x00 = no feedback, 0x01 = feedback Send_buf = 0x06 //the number of bytes of the command without starting byte and ending byte Void sendCommand(int8_t command, int16_t dat) SendCommand(CMD_PLAY_WITHVOLUME, 0X0F01) //play the first song with volume 15 classĭelay(1000000) //the programm will send the play option each 100 seconds to the catalex chip SendCommand(CMD_SEL_DEV, DEV_TF) //select the TF card MySerial.begin(9600) //Start our Serial coms for THE MP3ĭelay(500) //Wait chip initialization is complete Serial.begin(9600) //Start our Serial coms for serial monitor in our pc #define SET_DAC 0X17//data is needed 00 start DAC OUTPUT 01 DAC no output To enable on demand time domain data send this command in configuration mode. #define SET_CYCLEPLAY 0X19//data is needed 00 start 01 close This command needs to be sent within 1 sec of data reception. #define PLAY_FOLDER 0X17// data is needed 0x7E 06 17 00 01 XX EF (play the 01 folder)(value xx we dont care) #define CMD_PLAY_WITHFOLDER 0X0F//DATA IS NEEDED, 0x7E 06 0F 00 01 02 EF (play the song with the directory \01\002xxxxxx.mp3 #define CMD_PAUSE 0X0E //PLAYBACK IS PAUSED #define DEV_TF 0X02 //HELLO,IM THE DATA REQUIRED #define CMD_SEL_DEV 0X09 //SELECT STORAGE DEVICE, DATA IS REQUIRED #define CMD_PLAY_WITHVOLUME 0X22 //data is needed 0x7E 06 22 00 xx yy EF (xx volume)(yy number of song) #define CMD_SET_VOLUME 0X06//DATA IS REQUIRED (number of volume from 0 up to 30(0x1E)) #define CMD_PLAY_W_INDEX 0X03 //DATA IS REQUIRED (number of song) 0X7E FF 06 command 00 00 00 EF (if command =01 next song order) Static int8_t Send_buf = //The MP3 player undestands orders in a 8 int string all the commands needed in the datasheet() SoftwareSerial mySerial(ARDUINO_RX, ARDUINO_TX) //init the serial protocol, tell to myserial wich pins are TX and RX #define ARDUINO_TX 6//connect to RX of the module #define ARDUINO_RX 5//should connect to TX of the Serial MP3 Player module I tried this code found on this project, but nothing happens : //code rearranged by Javier Muñoz ask me at So i received the module and tried to use it separately with a Uno first to understand it better. ideally i want the arduino to play one song on it's own after other action in the code (like activiting the steppers and relays). Once the sensor gets this command it will send RMS, Max,Min, vibration data plus the time domain data.I'm trying to use YX5300 module in a project with Arduino Mega and also steppers motors and relays. Once the gateway receives the data, it needs to send a command to request time domain dataħE 00 13 10 01 00 00 00 00 00 00 FF FF FF FE 00 00 F8 99 00 00 28 3A To enable on demand time domain data send this command in configuration modeħE 00 14 10 00 00 00 00 00 00 00 FF FF FF FE 00 00 F4 08 00 00 28 04 CC This command needs to be sent within 1 sec of data reception. Then you can send a command to request the time domain data. Let say you see an abnormality in RMS, Max and Min data.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |