Go Down

Topic: Code to play specific sounds using the UART Serial MP3 Music Player Module (Read 455 times) previous topic - next topic

mikka276

Hi,
I have recently purchased the UART Serial MP3 Music Player Module for my project. Basically, my project uses an Arduino and hall effect sensors to trigger specific sounds depending on what combination of values the sensors provide.

My question is how to use the SoftwareSerial library when trying to select specific sounds to play. I've done a whole heap of research and I still can't understand the commands and the code.

This is the code I keep on running into:

Code: [Select]

#include <SoftwareSerial.h>

/Command byte**************/
/basic commands/
#define CMD_PLAY 0X01
#define CMD_PAUSE 0X02
#define CMD_NEXT_SONG 0X03
#define CMD_PREV_SONG 0X04
#define CMD_VOLUME_UP 0X05
#define CMD_VOLUME_DOWN 0X06
#define CMD_FORWARD 0X0A // >>
#define CMD_REWIND 0X0B // <<
#define CMD_STOP 0X0E
#define CMD_STOP_INJECT 0X0F//stop interruptting with a song, just stop the interlude

/5 bytes commands/
#define CMD_SEL_DEV 0X35
#define DEV_TF 0X01
#define CMD_IC_MODE 0X35
#define CMD_SLEEP 0X03
#define CMD_WAKE_UP 0X02
#define CMD_RESET 0X05

/6 bytes commands/
#define CMD_PLAY_W_INDEX 0X41
#define CMD_PLAY_FILE_NAME 0X42
#define CMD_INJECT_W_INDEX 0X43

/Special commands/
#define CMD_SET_VOLUME 0X31
#define CMD_PLAY_W_VOL 0X31

#define CMD_SET_PLAY_MODE 0X33
#define ALL_CYCLE 0X00
#define SINGLE_CYCLE 0X01

#define CMD_PLAY_COMBINE 0X45//can play combination up to 15 songs


Also, if someone could explain this code:
Code: [Select]

#define ARDUINO_RX 5//connect to TX pin of the Serial MP3 Player module
#define ARDUINO_TX 4//connect to RX pin of the Serial MP3 Player module
SoftwareSerial myMP3(ARDUINO_RX, ARDUINO_TX);//create a myMP3 object

static int8_t Send_buf[6] = {0} ;


Thanks.

Go Up