Your EasyEDA usage duration is brief. In order to avoid advertising information, this action is not supported at present. Please extend your EasyEDA usage duration and try again.
Editor Version×
recommended
Pro Edition
Brand new interactions and interfaces
Smooth support for design sizes of over 3W
devices or 10W pads
More rigorous design constraints, more
standardized processes
For enterprises, more professional users
Std Edition
Easy to use and quick to get started
The process supports design scales of 300
devices or 1000 pads
Supports simple circuit simulation
For students, teachers, creators
Ongoing
STD
Grove - Serial MP3 Player
Grove - Serial MP3 Player
Project tags
License
License:
Mode:
Mode
Editors' pick
Editors' pick
2.1k
0
0
1
Update time:
2021-04-09 17:56:57
Creation time:
2016-01-15 12:30:23
Description
Description
Grove - Serial MP3 Player
-------------------------
![enter image description here][1]
Grove-Serial MP3 Player is a kind of simple MP3 player device whose design is based on a high-quality MP3 audio chip---WT5001.
It can support 8KHZ~44.1KHZ sampling frequency MP3 and WAV file formats.
This product has several peripheral ports: a standard UART Grove interface, a dual track headphone jack, an external interface and also a micro SD card interface.
You can control the MP3 playback state by sending commands to module via serial port tools, such as switch songs, change the volume and play mode and so on.
It seems a simple module, but it owns such strong function. Want to know how the sound quality? Please come to experience it!
Features
Standard Grove interface
Asynchronous serial port control play mode
Busy Indicator
Reset Button
Standard micro SD card Interface
Support FAT16 and FAT32 file system
For more detail, please visit: http://www.seeedstudio.com/item_detail.html?p_id=1542
/*****************************************************************************/
// Function: control the seeedstudio Grove MP3 player
// Hardware: Grove - Serial MP3 Player
/*******************************************************************************/
#include
SoftwareSerial mp3(2, 3);//modify this with the connector you are using.
void setup()
{
mp3.begin(9600);
Serial.begin(9600);
delay(100);
if (true ==SetPlayMode(0x01))
Serial.println("Set The Play Mode to 0x01, Single Loop Mode.");
else
Serial.println("Playmode Set Error");
PauseOnOffCurrentMusic();
}
void loop()
{
SetPlayMode(0x01);
delay(1000);
SetMusicPlay(00,01);
delay(1000);
SetVolume(0x0E);
while(1);
}
//Set the music index to play, the index is decided by the input sequence
//of the music;
//hbyte: the high byte of the index;
//lbyte: the low byte of the index;
boolean SetMusicPlay(uint8_t hbyte,uint8_t lbyte)
{
mp3.write(0x7E);
mp3.write(0x04);
mp3.write(0xA0);
mp3.write(hbyte);
mp3.write(lbyte);
mp3.write(0x7E);
delay(10);
while(mp3.available())
{
if (0xA0==mp3.read())
return true;
else
return false;
}
}
// Pause on/off the current music
boolean PauseOnOffCurrentMusic(void)
{
mp3.write(0x7E);
mp3.write(0x02);
mp3.write(0xA3);
mp3.write(0x7E);
delay(10);
while(mp3.available())
{
if (0xA3==mp3.read())
return true;
else
return false;
}
}
//Set the volume, the range is 0x00 to 0x1F
boolean SetVolume(uint8_t volume)
{
mp3.write(0x7E);
mp3.write(0x03);
mp3.write(0xA7);
mp3.write(volume);
mp3.write(0x7E);
delay(10);
while(mp3.available())
{
if (0xA7==mp3.read())
return true;
else
return false;
}
}
boolean SetPlayMode(uint8_t playmode)
{
if (((playmode==0x00)|(playmode==0x01)|(playmode==0x02)|(playmode==0x03))==false)
{
Serial.println("PlayMode Parameter Error! ");
return false;
}
mp3.write(0x7E);
mp3.write(0x03);
mp3.write(0xA9);
mp3.write(playmode);
mp3.write(0x7E);
delay(10);
while(mp3.available())
{
if (0xA9==mp3.read())
return true;
else
return false;
}
}
[1]: /editor/20160115/5698e6ebd829b.png
Forked project will be set private in personal workspace. Do you continue?
Clone
Project
The Pro editor is about to be opened to save as. Do you want to continue?
private message
Send message to seeedstudio
Delete
Comment
Are you sure to delete the comment?
Report
Grove - Serial MP3 Player
No Profile
Announcer: seeedstudio
Creation time: 2016-01-15 12:30:23
Published time:
2021-04-09 17:56:57
*
Report type:
Please select report type
*
Report reason:
Please fill in the reason for your report and the content is 2-1000
words
*
Upload image:
+
Upload image
*
Email address:
Please fill in your email address
Report
*
Report type:
Please select report type
*
Report reason:
Please fill in the reason for your report and the content is 2-1000
words
*
Upload image:
+
Upload image
*
Email address:
Please fill in your email address
Report
Submitted successfully! The review result can be viewed in the personal
center, review notification.
Kind tips
Your EasyEDA usage duration is brief. In order to avoid advertising information, this action is
not supported at present. Please extend your EasyEDA usage duration and try again.
Share
Project
Copy
Copy
Scan the QR code and open it on the mobile terminal