<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-CN">
		<id>http:///https//wiki.microduino.cn/index.php?action=history&amp;feed=atom&amp;title=Music_Player</id>
		<title>Music Player - 版本历史</title>
		<link rel="self" type="application/atom+xml" href="http:///https//wiki.microduino.cn/index.php?action=history&amp;feed=atom&amp;title=Music_Player"/>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Music_Player&amp;action=history"/>
		<updated>2026-04-21T07:58:29Z</updated>
		<subtitle>本wiki的该页面的版本历史</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=Music_Player&amp;diff=2955&amp;oldid=prev</id>
		<title>Pkj：Created page with &quot;{| style=&quot;width: 800px;&quot; |- | ==Objective==  The course will show you how to control Microduino modules to achieve a music player by using Processing.   ==Equipment== *'''Mi...&quot;</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Music_Player&amp;diff=2955&amp;oldid=prev"/>
				<updated>2014-06-09T08:11:30Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;{| style=&amp;quot;width: 800px;&amp;quot; |- | ==Objective==  The course will show you how to control Microduino modules to achieve a music player by using Processing.   ==Equipment== *&amp;#039;&amp;#039;&amp;#039;Mi...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{| style=&amp;quot;width: 800px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
==Objective==&lt;br /&gt;
&lt;br /&gt;
The course will show you how to control Microduino modules to achieve a music player by using Processing. &lt;br /&gt;
&lt;br /&gt;
==Equipment==&lt;br /&gt;
*'''[[Microduino-Core]]'''&lt;br /&gt;
*'''[[Microduino-FT232R]]'''&lt;br /&gt;
*'''[[Microduino-SD]]'''&lt;br /&gt;
*'''[[Microduino-LM4863]]'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Other Hardware Equipment &lt;br /&gt;
**A USB cable   &lt;br /&gt;
**A loudspeaker &lt;br /&gt;
**A storage card &lt;br /&gt;
&lt;br /&gt;
==Schematic==&lt;br /&gt;
&lt;br /&gt;
Just stack the four Microduino modules mentioned above and connect the two wires of the loudspeaker to Microduino-LM4863   &lt;br /&gt;
&lt;br /&gt;
==Program==&lt;br /&gt;
&lt;br /&gt;
https://github.com/Microduino/Microduino_Tutorials/tree/master/Microduino_Processing/MicroduinoMusicplayer&lt;br /&gt;
&lt;br /&gt;
https://github.com/Microduino/Microduino_Tutorials/tree/master/Microduino_Processing/ProcessingMusicplayer&lt;br /&gt;
&lt;br /&gt;
==Debugging==&lt;br /&gt;
&lt;br /&gt;
Step 1：The hardware building of the circuit can refer to:&lt;br /&gt;
http://www.microduino.cc/wiki/index.php?title=Microduino_LM4863%E9%9F%B3%E4%B9%90%E6%92%AD%E6%94%BE%E5%99%A8-301KIT/zh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Insert the storage card into the slot of Microduino SD  &lt;br /&gt;
[[File:301KIT-SD.jpg|600px|center|thumb|301KIT-SD]]&lt;br /&gt;
*Connect the loudspeaker &lt;br /&gt;
[[File:301KIT-speaker.jpg|600px|center|thumb|301KIT-Speak]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Build the hardware environment according to the schematic, just like this: &lt;br /&gt;
[[File:processingMusicplayerConnectionDiagram.jpg|600px|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Step 2：Audio Production  &lt;br /&gt;
*A SoX-based tool will be needed. And you can choose a proper conversion program according to the operational frequency of you Microduino modules.  &lt;br /&gt;
*Extract the file to “Microduino with 16 MHz” folder and put the audio file into the folder, then select “FullRate@16MHz_Mono.bat” &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
[[File:audio-1.jpg|600px|center|thumb|Audio]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
*A dialog box will pop up, showing “Press any key to continue...”&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
[[File:audio-2.jpg|600px|center|thumb|Audio]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
*After that, there appears a newly created folder and you will find the converted file inside. If failed, you can convert the audio file to “wav” format and have another try. &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
[[File:audio-3.jpg|600px|center|thumb|Audio]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
*Copy the converted audio file to the storage card and insert the card into Microduino SD card slot. &lt;br /&gt;
*Use IED to open the test program offered by Microduino and choose Microduino Core (Atmega328P@16M,5V). Here the things should be noticed before program download: &lt;br /&gt;
**Since some libraries may have different pin definition, please download the changed libraries and replace the former ones; &lt;br /&gt;
**The name of the audio file should also be changed to that of the generated audio file. &lt;br /&gt;
&lt;br /&gt;
Step 3：Here the code needed：&lt;br /&gt;
&lt;br /&gt;
The code of two ends (Processing and Microduino)   &lt;br /&gt;
&lt;br /&gt;
Microduino:&lt;br /&gt;
&lt;br /&gt;
//The code keeps consistent with that of the 301kit of Microduino-LM4863 music player. The difference is the added function of receiving serial data   &lt;br /&gt;
    if(Serial.available())&lt;br /&gt;
    {&lt;br /&gt;
      command=Serial.read();&lt;br /&gt;
      Serial.println(command);&lt;br /&gt;
      SdPlay.worker();&lt;br /&gt;
      if(num_two!=num_one)&lt;br /&gt;
      {&lt;br /&gt;
        num_two=num_one ;&lt;br /&gt;
        if(command=='p') {//’p’ means play&lt;br /&gt;
          SdPlay.play();&lt;br /&gt;
          Serial.println(F(&amp;quot;Play.&amp;quot;));&lt;br /&gt;
        }&lt;br /&gt;
        else if(command=='t') {//’t’ means stop&lt;br /&gt;
          SdPlay.pause();&lt;br /&gt;
          Serial.println(F(&amp;quot;Pause.&amp;quot;));&lt;br /&gt;
        }&lt;br /&gt;
        Serial.println(ok);&lt;br /&gt;
        Serial.print(num_one);&lt;br /&gt;
        Serial.println(num_two);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Processing:&lt;br /&gt;
&lt;br /&gt;
//Get the data of the first serial port. &lt;br /&gt;
  println(Serial.list());&lt;br /&gt;
  // is always my Arduino, so I open Serial.list()[0].&lt;br /&gt;
  // Open whatever port is the one you're using.&lt;br /&gt;
  port = new Serial(this, Serial.list()[0], 9600);&lt;br /&gt;
&lt;br /&gt;
//Add background-image, judge the mouse click, send play or pause instructions to Microduino to control the music player &lt;br /&gt;
  void draw() {&lt;br /&gt;
    image(bg, 0, 0);&lt;br /&gt;
    if (button) {&lt;br /&gt;
      image(play, x, y);&lt;br /&gt;
      port.write(&amp;quot;p&amp;quot;);&lt;br /&gt;
    } &lt;br /&gt;
    else {&lt;br /&gt;
      image(pause, x, y);&lt;br /&gt;
      port.write(&amp;quot;t&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Step 4：Download the code and get it compiled successfully. &lt;br /&gt;
&lt;br /&gt;
Step 5：After the system goes well, a disk music player will appear on the screen. Click the button in the middle to see what happens. &lt;br /&gt;
&lt;br /&gt;
==Result==&lt;br /&gt;
&lt;br /&gt;
The music player starts or pauses along with the click of the button, just like this:.&lt;br /&gt;
[[File:processingMusicplayerResult.jpg|600px|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Video==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Pkj</name></author>	</entry>

	</feed>