<?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=Lesson_22--Microduino_%22Serial_port_debugging%22</id>
		<title>Lesson 22--Microduino &quot;Serial port debugging&quot; - 版本历史</title>
		<link rel="self" type="application/atom+xml" href="http:///https//wiki.microduino.cn/index.php?action=history&amp;feed=atom&amp;title=Lesson_22--Microduino_%22Serial_port_debugging%22"/>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Lesson_22--Microduino_%22Serial_port_debugging%22&amp;action=history"/>
		<updated>2026-05-09T23:30:33Z</updated>
		<subtitle>本wiki的该页面的版本历史</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=Lesson_22--Microduino_%22Serial_port_debugging%22&amp;diff=1209&amp;oldid=prev</id>
		<title>2014年3月2日 (日) 15:03 Pkj</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Lesson_22--Microduino_%22Serial_port_debugging%22&amp;diff=1209&amp;oldid=prev"/>
				<updated>2014-03-02T15:03:49Z</updated>
		
		<summary type="html">&lt;p&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年3月2日 (日) 15:03的版本&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-l1&quot; &gt;第1行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第1行：&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;{{Language|&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Lesson_22&lt;/del&gt;--&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Microduino_&amp;quot;Serial_port_debugging&amp;quot; &lt;/del&gt;}}&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;{{Language|&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;第二十二课&lt;/ins&gt;--&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Microduino_串口调试&lt;/ins&gt;}}&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;{| style=&amp;quot;width: 800px;&amp;quot;&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;{| style=&amp;quot;width: 800px;&amp;quot;&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;|-&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;|-&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=Lesson_22--Microduino_%22Serial_port_debugging%22&amp;diff=1172&amp;oldid=prev</id>
		<title>2014年3月2日 (日) 14:32 Pkj</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Lesson_22--Microduino_%22Serial_port_debugging%22&amp;diff=1172&amp;oldid=prev"/>
				<updated>2014-03-02T14:32:18Z</updated>
		
		<summary type="html">&lt;p&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年3月2日 (日) 14:32的版本&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-l1&quot; &gt;第1行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第1行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Language|Lesson_22--Microduino_&amp;quot;Serial_port_debugging&amp;quot; }}&lt;/ins&gt;&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;{| style=&amp;quot;width: 800px;&amp;quot;&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;{| style=&amp;quot;width: 800px;&amp;quot;&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;|-&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;|-&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=Lesson_22--Microduino_%22Serial_port_debugging%22&amp;diff=779&amp;oldid=prev</id>
		<title>Jasonsheng：Created page with &quot;{| style=&quot;width: 800px;&quot; |- | ==Objective== In perious experiment, serial port is used to monitor data that means program write data to serial. This lesson will show how to re...&quot;</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Lesson_22--Microduino_%22Serial_port_debugging%22&amp;diff=779&amp;oldid=prev"/>
				<updated>2014-02-20T07:18:25Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;{| style=&amp;quot;width: 800px;&amp;quot; |- | ==Objective== In perious experiment, serial port is used to monitor data that means program write data to serial. This lesson will show how to re...&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;
In perious experiment, serial port is used to monitor data that means program write data to serial. This lesson will show how to read data the serial port received.&lt;br /&gt;
&lt;br /&gt;
==Equipment==&lt;br /&gt;
'''[[Microduino-Core]]'''&lt;br /&gt;
'''[[Microduino-FT232R]]'''&lt;br /&gt;
*Other hardware equipment&lt;br /&gt;
**Breadboard Jumper            one box   &lt;br /&gt;
**Breadboard  	               one piece  &lt;br /&gt;
**LED                          one &lt;br /&gt;
**220Ω resistor     	         one &lt;br /&gt;
**USB Data cable               one&lt;br /&gt;
&lt;br /&gt;
==Experiment 1==&lt;br /&gt;
*Serial receives character string&lt;br /&gt;
Only need Microduino core and Microduino Ft232RL moduile, no other module.&lt;br /&gt;
Program：&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
String comdata = &amp;quot;&amp;quot;;//Define a String variable&lt;br /&gt;
void setup()&lt;br /&gt;
{&lt;br /&gt;
 Serial.begin(115200);//Set the baud rate&lt;br /&gt;
}&lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
    while (Serial.available() &amp;gt; 0)  // If there is serial buffer data, continuous cycle&lt;br /&gt;
    {        &lt;br /&gt;
comdata += char(Serial.read());   //Read data, only read one byte every time&lt;br /&gt;
     delay(2);//serial buffer time&lt;br /&gt;
    }&lt;br /&gt;
    if (comdata.length() &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
Serial.println(comdata);  //Print serial data   &lt;br /&gt;
   comdata = &amp;quot;&amp;quot;;//Clean the data&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Result：In serial monitor box, fill in any data in send window, then click send(or press enter),at the receive data window will display the data.&lt;br /&gt;
[[File:lesson22-send.jpg|600px|center|thumb]]&lt;br /&gt;
[[File:lesson22-receive.jpg|600px|center|thumb]]&lt;br /&gt;
'''Note：'''&lt;br /&gt;
*String type variable converts the characters into the string simplely and can directly output a string or assignment.&lt;br /&gt;
*while (Serial.available() &amp;gt; 0): &amp;quot;While&amp;quot; can't change to &amp;quot;if&amp;quot;, otherwise only can read one character.&lt;br /&gt;
*delay(2): Can't delete this, otherwise the serial buffer doesn't have enough time to receive new data.&lt;br /&gt;
*comdata = &amp;quot;&amp;quot;: Can't delete this, otherwise serial port data will be added continuously.&lt;br /&gt;
*comdata defines the character string, that is array, you can use comdata[0]，comdata[1]、、、comdata[n] to quote every data.&lt;br /&gt;
&lt;br /&gt;
==Experiment 2==&lt;br /&gt;
*Serial control LED&lt;br /&gt;
Program：&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
String comdata = &amp;quot;&amp;quot;;//Define a String variable&lt;br /&gt;
int led=LOW;&lt;br /&gt;
void setup()&lt;br /&gt;
{&lt;br /&gt;
  Serial.begin(115200);//Set the baud rate&lt;br /&gt;
  pinMode(13, OUTPUT);&lt;br /&gt;
}&lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  while (Serial.available() &amp;gt; 0)  //If there is serial buffer data, continuous cycle&lt;br /&gt;
  {        &lt;br /&gt;
    comdata += char(Serial.read());   //Read data, only read one byte every time&lt;br /&gt;
    delay(2);//serial buffer time&lt;br /&gt;
  }&lt;br /&gt;
  if (comdata==&amp;quot;on&amp;quot;)&lt;br /&gt;
    led = HIGH;&lt;br /&gt;
  else if(comdata==&amp;quot;off&amp;quot;)&lt;br /&gt;
    led = LOW;&lt;br /&gt;
  digitalWrite(13,led);&lt;br /&gt;
  if (comdata.length() &amp;gt; 0)&lt;br /&gt;
  {&lt;br /&gt;
    Serial.print(comdata);  //Print serial data&lt;br /&gt;
    Serial.print(&amp;quot;   led:&amp;quot;);  //Print serial data&lt;br /&gt;
    Serial.println(led);  //Print LED state&lt;br /&gt;
&lt;br /&gt;
    comdata = &amp;quot;&amp;quot;;//Clean data&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Result：&lt;br /&gt;
*LED monitor：&lt;br /&gt;
Pin D13 connects to a LED. In serial monitor box, write &amp;quot;on&amp;quot; in send window, then click send (or press enter)，LED light. Write &amp;quot;off&amp;quot;, click send (or press enter), LED off. LED keep the last state in other situation.&lt;br /&gt;
&lt;br /&gt;
*Serian monitor&lt;br /&gt;
In serial monitor box, write &amp;quot;on&amp;quot; in send window, then click send (or press enter)，return &amp;quot;“on   led:1”. Write &amp;quot;off&amp;quot;, click send (or press enter), return “off   led:0”. In other situation, return sent data and LED keep the last state.&lt;br /&gt;
&lt;br /&gt;
[[File:lesson22-command.jpg|600px|center|thumb]]&lt;br /&gt;
Serial receives character string, please refer to：http://www.geek-workshop.com/thread-158-1-1.html&lt;br /&gt;
&lt;br /&gt;
Serial receives character string and convert to array, please refer to：http://www.geek-workshop.com/thread-260-1-1.html&lt;br /&gt;
==Video==&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jasonsheng</name></author>	</entry>

	</feed>