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

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=Control_stepper_motor&amp;diff=2911&amp;oldid=prev</id>
		<title>Pkj：/* Result */</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Control_stepper_motor&amp;diff=2911&amp;oldid=prev"/>
				<updated>2014-06-06T07:13:23Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Result&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日 (五) 07:13的版本&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-l117&quot; &gt;第117行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第117行：&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;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;When putting the mouse on the “boy &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;in &lt;/del&gt;the left”:&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;When putting the mouse on the “boy &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;on &lt;/ins&gt;the left”:&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;div&gt;[[File:processingStepperControlResult1.jpg|600px|center|thumb]]&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;[[File:processingStepperControlResult1.jpg|600px|center|thumb]]&lt;/div&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;When putting the mouse on the “girl &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;in &lt;/del&gt;the right”：&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;When putting the mouse on the “girl &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;on &lt;/ins&gt;the right”：&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;div&gt;[[File:processingStepperControlResult2.jpg|600px|center|thumb]]&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;[[File:processingStepperControlResult2.jpg|600px|center|thumb]]&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;The stepper motor will turn in the appropriate direction &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;The stepper motor will turn in the appropriate direction&lt;/div&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;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&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;==Video==&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;==Video==&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=Control_stepper_motor&amp;diff=2910&amp;oldid=prev</id>
		<title>Pkj：Created page with &quot;{| style=&quot;width: 800px;&quot; |- | ==Objective==  The course will show you how to control stepper motor via “Processing”.   ==Equipment== *'''Microduino-Core''' *'''Micro...&quot;</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Control_stepper_motor&amp;diff=2910&amp;oldid=prev"/>
				<updated>2014-06-06T07:09:23Z</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 stepper motor via “Processing”.   ==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;#039;&amp;#039;&amp;#039; *&amp;#039;&amp;#039;&amp;#039;Micro...&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 stepper motor via “Processing”. &lt;br /&gt;
&lt;br /&gt;
==Equipment==&lt;br /&gt;
*'''[[Microduino-Core]]'''&lt;br /&gt;
*'''[[Microduino-FT232R]]'''&lt;br /&gt;
'''[[Microduino-A4982]]'''&lt;br /&gt;
&lt;br /&gt;
*Other Hardware Equipment &lt;br /&gt;
**A USB cable  &lt;br /&gt;
**A pegboard &lt;br /&gt;
**A copper cylinder and a screw &lt;br /&gt;
&lt;br /&gt;
*Welding tools &lt;br /&gt;
**Electric iron&lt;br /&gt;
**Tin solder &lt;br /&gt;
**Wire &lt;br /&gt;
**Tweezer &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Schematic==&lt;br /&gt;
&lt;br /&gt;
[[File:Stepper_motor.jpg|600px|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
==Program==&lt;br /&gt;
&lt;br /&gt;
https://github.com/Microduino/Microduino_Tutorials/tree/master/Microduino_Processing/MicroduinoStepperControl&lt;br /&gt;
&lt;br /&gt;
https://github.com/Microduino/Microduino_Tutorials/tree/master/Microduino_Processing/ProcessingStepperControl&lt;br /&gt;
&lt;br /&gt;
==Debugging==&lt;br /&gt;
&lt;br /&gt;
The hardware buildup is similar to that of the DC motor in the 38th advanced course: &lt;br /&gt;
http://www.microduino.cc/wiki/index.php?title=%E7%AC%AC%E4%B8%89%E5%8D%81%E5%85%AB%E8%AF%BE--Microduino_%E6%AD%A5%E8%BF%9B%E7%94%B5%E6%9C%BA%E9%A9%B1%E5%8A%A8/zh&lt;br /&gt;
&lt;br /&gt;
*Step 1：Cut pegboard with the right size;  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Step 2：Make sure a right base location and weld the circuit according to the schematic;  &lt;br /&gt;
[[File:A4982.png|thumb|600px|center|洞洞板焊法]]&lt;br /&gt;
[[File:A4982_Stepper_motor-t.jpg|thumb|600px|center|正面]]&lt;br /&gt;
[[File:A4982_Stepper_motor-b.jpg|thumb|600px|center|反面]]&lt;br /&gt;
*Building the circuit &lt;br /&gt;
[[File:A4982_Stepper_motor-ok.jpg|thumb|600px|center|ok]]&lt;br /&gt;
&lt;br /&gt;
Step 3：Here is the code needed: &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;
//Read serial data &lt;br /&gt;
  void loop() {&lt;br /&gt;
    if(Serial.available())&lt;br /&gt;
    {&lt;br /&gt;
      command=Serial.read();&lt;br /&gt;
      Serial.println(command);&lt;br /&gt;
      if(command=='l') {//The stepper motor turns left if the data sent from Processing is 'l' &lt;br /&gt;
        stepper.setSpeed(motorSpeed);&lt;br /&gt;
        stepper.runSpeed();&lt;br /&gt;
      } &lt;br /&gt;
      else if(command=='r') {//The stepper motor turns right if the data sent from Processing is 'r' &lt;br /&gt;
        stepper.setSpeed(-motorSpeed);&lt;br /&gt;
        stepper.runSpeed();&lt;br /&gt;
      }&lt;br /&gt;
      else {&lt;br /&gt;
        stepper.stop();//otherwise, it will stop turning&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Processing:&lt;br /&gt;
&lt;br /&gt;
//Monitor the mouse during drawing function.&lt;br /&gt;
  void draw() &lt;br /&gt;
  {&lt;br /&gt;
    background(0);&lt;br /&gt;
    image(img,0,0);&lt;br /&gt;
    noFill();&lt;br /&gt;
    if(&amp;quot;left&amp;quot;.equals(turning)) {&lt;br /&gt;
      rect(30,80,150,210);&lt;br /&gt;
      fill(0);        //Specify font color&lt;br /&gt;
      text ( &amp;quot;turn left&amp;quot; ,250,20); &lt;br /&gt;
      port.write(&amp;quot;l&amp;quot;);&lt;br /&gt;
    }else if(&amp;quot;right&amp;quot;.equals(turning)) {&lt;br /&gt;
      rect(320,90,150,200);&lt;br /&gt;
      fill(0);        //Specify font color&lt;br /&gt;
      text ( &amp;quot;turn right&amp;quot; ,250,20); &lt;br /&gt;
      port.write(&amp;quot;r&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
//Move the mouse and judge if it it inside the selection area&lt;br /&gt;
  // When the mouse is moved, the state of the turning is toggled.&lt;br /&gt;
  void mouseMoved() {&lt;br /&gt;
    if (mouseX &amp;gt; 30 &amp;amp;&amp;amp; mouseX &amp;lt; 180 &amp;amp;&amp;amp; mouseY &amp;gt; 80 &amp;amp;&amp;amp; mouseY &amp;lt; 290) {&lt;br /&gt;
      turning = &amp;quot;left&amp;quot;;&lt;br /&gt;
      cursor(HAND);&lt;br /&gt;
    }&lt;br /&gt;
    else if (mouseX &amp;gt; 320 &amp;amp;&amp;amp; mouseX &amp;lt; 470 &amp;amp;&amp;amp; mouseY &amp;gt; 90 &amp;amp;&amp;amp; mouseY &amp;lt; 290) {&lt;br /&gt;
      turning = &amp;quot;right&amp;quot;;&lt;br /&gt;
      cursor(HAND);&lt;br /&gt;
    }&lt;br /&gt;
    else {&lt;br /&gt;
      turning = &amp;quot;turning&amp;quot;;&lt;br /&gt;
      cursor(ARROW);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Step 4：Download the code and pass the compiling. &lt;br /&gt;
&lt;br /&gt;
Step 5：Put the mouse on the “boy in the left”  and the “girl in the right” to see the response of the stepper motor after the system goes well.  &lt;br /&gt;
==Result==&lt;br /&gt;
&lt;br /&gt;
When putting the mouse on the “boy in the left”:&lt;br /&gt;
[[File:processingStepperControlResult1.jpg|600px|center|thumb]]&lt;br /&gt;
When putting the mouse on the “girl in the right”：&lt;br /&gt;
[[File:processingStepperControlResult2.jpg|600px|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
The stepper motor will turn in the appropriate direction &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>