<?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=DC_Motor_Control</id>
		<title>DC Motor Control - 版本历史</title>
		<link rel="self" type="application/atom+xml" href="http:///https//wiki.microduino.cn/index.php?action=history&amp;feed=atom&amp;title=DC_Motor_Control"/>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=DC_Motor_Control&amp;action=history"/>
		<updated>2026-04-30T11:50:56Z</updated>
		<subtitle>本wiki的该页面的版本历史</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=DC_Motor_Control&amp;diff=2923&amp;oldid=prev</id>
		<title>Pkj：/* Debugging */</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=DC_Motor_Control&amp;diff=2923&amp;oldid=prev"/>
				<updated>2014-06-06T08:49:26Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Debugging&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;zh-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;2014年6月6日 (五) 08:49的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l90&quot; &gt;第90行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第90行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Step 3：Download the code and &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;compile &lt;/del&gt;successfully. . &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Step 3：Download the code and &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;get it compiled &lt;/ins&gt;successfully. . &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Step 4：Move your mouse around in “Processing” after the system goes well to see speed change of the motor. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Step 4：Move your mouse around in “Processing” after the system goes well to see speed change of the motor.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Result==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Result==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Pkj</name></author>	</entry>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=DC_Motor_Control&amp;diff=2915&amp;oldid=prev</id>
		<title>Pkj：Created page with &quot;{| style=&quot;width: 800px;&quot; |- | ==Objective==  The course will show you how to use “Processing” to control the speed of the DC motor.   ==Equipment== *'''Microduino-Core...&quot;</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=DC_Motor_Control&amp;diff=2915&amp;oldid=prev"/>
				<updated>2014-06-06T07:51:29Z</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 use “Processing” to control the speed of the DC motor.   ==Equipment== *&amp;#039;&amp;#039;&amp;#039;&lt;a href=&quot;/index.php/Microduino-Core&quot; title=&quot;Microduino-Core&quot;&gt;Microduino-Core&lt;/a&gt;...&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 use “Processing” to control the speed of the DC motor. &lt;br /&gt;
&lt;br /&gt;
==Equipment==&lt;br /&gt;
*'''[[Microduino-Core]]'''&lt;br /&gt;
*'''[[Microduino-FT232R]]'''&lt;br /&gt;
&lt;br /&gt;
*Other Hardware Equipment &lt;br /&gt;
**A USB cable &lt;br /&gt;
**A box of jumpers &lt;br /&gt;
**A breadboard&lt;br /&gt;
**A DC motor &lt;br /&gt;
**A potentiometer  &lt;br /&gt;
**A resistor of 2.2K Ω &lt;br /&gt;
**A diode  &lt;br /&gt;
**A transistor NPN&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Schematic==&lt;br /&gt;
&lt;br /&gt;
[[File:processingDCMotorSchematics.jpg|600px|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
==Program==&lt;br /&gt;
&lt;br /&gt;
Refer to MicroduinoDCMotorControl&lt;br /&gt;
&lt;br /&gt;
ProcessingDCMotorControl&lt;br /&gt;
&lt;br /&gt;
==Debugging==&lt;br /&gt;
&lt;br /&gt;
Step 1：Build hardware environment in accord with the schematic, just like this:  &lt;br /&gt;
[[File:processingDCMotorConnectionDiagram.jpg|600px|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Step 2：Here the code we need：&lt;br /&gt;
&lt;br /&gt;
The code of the two ends (Processing and Microduino)  &lt;br /&gt;
&lt;br /&gt;
Microduino:&lt;br /&gt;
&lt;br /&gt;
//Send output value to the motor after getting the serial data &lt;br /&gt;
&lt;br /&gt;
  if(Serial.available())//if serial is available&lt;br /&gt;
  {&lt;br /&gt;
    leitura=Serial.read();//read serial data&lt;br /&gt;
    Serial.println(leitura);&lt;br /&gt;
    vel=map(leitura,0,255,0,1023);//map&lt;br /&gt;
    if(leitura&amp;gt;0)//run motor by leitura&lt;br /&gt;
    {&lt;br /&gt;
      analogWrite(motorPin,vel);&lt;br /&gt;
      delay(1);&lt;br /&gt;
    }&lt;br /&gt;
    else//stop motor&lt;br /&gt;
    {&lt;br /&gt;
      analogWrite(motorPin,LOW);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Processing:&lt;br /&gt;
&lt;br /&gt;
//List all the serial ports and get data of the first serial port &lt;br /&gt;
  // List all the available serial ports in the output pane.&lt;br /&gt;
  // You will need to choose the port that the Wiring board is&lt;br /&gt;
  // connected to from this list. The first port in the list is&lt;br /&gt;
  // port #0 and the third port in the list is port #2.&lt;br /&gt;
  println(Serial.list());&lt;br /&gt;
  // Open the port that the Wiring board is connected to (in this case #0)&lt;br /&gt;
  // Make sure to open the port at the same speed Wiring is using (9600bps)&lt;br /&gt;
  port = new Serial(this, Serial.list()[0], 9600);&lt;br /&gt;
&lt;br /&gt;
//Draw and update&lt;br /&gt;
  void draw() &lt;br /&gt;
  {&lt;br /&gt;
    background(0);&lt;br /&gt;
    update(mouseX/10); &lt;br /&gt;
    println(mouseX);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
//Transmit the x-coordinate value of the mouse through the serial port and draw the current value on Processing &lt;br /&gt;
  void update(int x) &lt;br /&gt;
  {&lt;br /&gt;
    port.write(x);&lt;br /&gt;
    stroke(255);  &lt;br /&gt;
    line(mouseX, 0, mouseX, 160);   &lt;br /&gt;
    text (mouseX, mouseX, 180);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Step 3：Download the code and compile successfully. . &lt;br /&gt;
&lt;br /&gt;
Step 4：Move your mouse around in “Processing” after the system goes well to see speed change of the motor. &lt;br /&gt;
&lt;br /&gt;
==Result==&lt;br /&gt;
&lt;br /&gt;
A simple speed indicator will be displayed on the screen. The speed of the motor will change along with the change of your mouse on the x-coordinate. &lt;br /&gt;
[[File:processingDCMotorResult.jpg|600px|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Video==&lt;/div&gt;</summary>
		<author><name>Pkj</name></author>	</entry>

	</feed>