<?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=%E7%AC%AC%E4%BA%8C%E5%8D%81%E8%AF%BE--Microduino_%E4%B8%AD%E6%96%AD%E7%9A%84%E4%BD%BF%E7%94%A8%2Fzh</id>
		<title>第二十课--Microduino 中断的使用/zh - 版本历史</title>
		<link rel="self" type="application/atom+xml" href="http:///https//wiki.microduino.cn/index.php?action=history&amp;feed=atom&amp;title=%E7%AC%AC%E4%BA%8C%E5%8D%81%E8%AF%BE--Microduino_%E4%B8%AD%E6%96%AD%E7%9A%84%E4%BD%BF%E7%94%A8%2Fzh"/>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=%E7%AC%AC%E4%BA%8C%E5%8D%81%E8%AF%BE--Microduino_%E4%B8%AD%E6%96%AD%E7%9A%84%E4%BD%BF%E7%94%A8/zh&amp;action=history"/>
		<updated>2026-04-20T16:59:53Z</updated>
		<subtitle>本wiki的该页面的版本历史</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=%E7%AC%AC%E4%BA%8C%E5%8D%81%E8%AF%BE--Microduino_%E4%B8%AD%E6%96%AD%E7%9A%84%E4%BD%BF%E7%94%A8/zh&amp;diff=9155&amp;oldid=prev</id>
		<title>2015年8月6日 (四) 05:52 963029146@qq.com</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=%E7%AC%AC%E4%BA%8C%E5%8D%81%E8%AF%BE--Microduino_%E4%B8%AD%E6%96%AD%E7%9A%84%E4%BD%BF%E7%94%A8/zh&amp;diff=9155&amp;oldid=prev"/>
				<updated>2015-08-06T05:52:02Z</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;2015年8月6日 (四) 05:52的版本&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-l64&quot; &gt;第64行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第64行：&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;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; &amp;#160; unsigned long nowtime=millis(); //获取当前的系统运行时间长度&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; &amp;#160; unsigned long nowtime=millis(); //获取当前的系统运行时间长度&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;&amp;#160; &amp;#160; if(ledStatus==HIGH)&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  //&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;如果当前lled灯状态为高电平，则执行该程序&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;&amp;#160;&amp;#160; &amp;#160; if(ledStatus==HIGH)&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  //&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;如果当前led灯状态为高电平，则执行该程序&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;&amp;#160;&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; &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;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; if(nowtime&amp;gt;ledOn)&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  //检测系统运行时间长度是否到500ms&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; &amp;#160; &amp;#160; if(nowtime&amp;gt;ledOn)&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  //检测系统运行时间长度是否到500ms&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>963029146@qq.com</name></author>	</entry>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=%E7%AC%AC%E4%BA%8C%E5%8D%81%E8%AF%BE--Microduino_%E4%B8%AD%E6%96%AD%E7%9A%84%E4%BD%BF%E7%94%A8/zh&amp;diff=5126&amp;oldid=prev</id>
		<title>Radiumray9@gmail.com：/* 设备 */</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=%E7%AC%AC%E4%BA%8C%E5%8D%81%E8%AF%BE--Microduino_%E4%B8%AD%E6%96%AD%E7%9A%84%E4%BD%BF%E7%94%A8/zh&amp;diff=5126&amp;oldid=prev"/>
				<updated>2014-10-29T03:33:51Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;设备&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年10月29日 (三) 03:33的版本&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-l6&quot; &gt;第6行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第6行：&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;本教程为了了解microduino定时器中断,用定时器中断让13引脚 led灯每500ms变化一次&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;本教程为了了解microduino定时器中断,用定时器中断让13引脚 led灯每500ms变化一次&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;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;'''[[Microduino-Core]]'''&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;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;*&lt;/ins&gt;'''[[Microduino-Core&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;/zh&lt;/ins&gt;]]'''&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;'''[[Microduino-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;FT232R&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;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;*&lt;/ins&gt;'''[[Microduino-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;USBTTL/zh&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;*其他硬件设备&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;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; &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; &amp;#160;&lt;/div&gt;&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-l13&quot; &gt;第13行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第13行：&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;**LED发光二极管&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;**LED发光二极管&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;div&gt;**220欧姆电阻&amp;#160; 	 一个&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;**220欧姆电阻&amp;#160; 	 一个&amp;#160; &amp;#160;&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;**USB数据连接线&amp;#160; 一根 &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;**USB数据连接线&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;&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>Radiumray9@gmail.com</name></author>	</entry>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=%E7%AC%AC%E4%BA%8C%E5%8D%81%E8%AF%BE--Microduino_%E4%B8%AD%E6%96%AD%E7%9A%84%E4%BD%BF%E7%94%A8/zh&amp;diff=1226&amp;oldid=prev</id>
		<title>Pkj：Created page with &quot;{{Language|Lesson_20--Microduino_&quot;Use_Interrupt&quot;}} {| style=&quot;width: 800px;&quot; |- | ==目的== 本教程为了了解microduino定时器中断,用定时器中断让13引脚 led灯...&quot;</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=%E7%AC%AC%E4%BA%8C%E5%8D%81%E8%AF%BE--Microduino_%E4%B8%AD%E6%96%AD%E7%9A%84%E4%BD%BF%E7%94%A8/zh&amp;diff=1226&amp;oldid=prev"/>
				<updated>2014-03-02T15:12:33Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Language|Lesson_20--Microduino_&amp;quot;Use_Interrupt&amp;quot;}} {| style=&amp;quot;width: 800px;&amp;quot; |- | ==目的== 本教程为了了解microduino定时器中断,用定时器中断让13引脚 led灯...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Language|Lesson_20--Microduino_&amp;quot;Use_Interrupt&amp;quot;}}&lt;br /&gt;
{| style=&amp;quot;width: 800px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
==目的==&lt;br /&gt;
本教程为了了解microduino定时器中断,用定时器中断让13引脚 led灯每500ms变化一次&lt;br /&gt;
==设备==&lt;br /&gt;
'''[[Microduino-Core]]'''&lt;br /&gt;
'''[[Microduino-FT232R]]'''&lt;br /&gt;
*其他硬件设备&lt;br /&gt;
**面包板跳线  	 一盒  &lt;br /&gt;
**面包板  	 一块  &lt;br /&gt;
**LED发光二极管  一个&lt;br /&gt;
**220欧姆电阻  	 一个  &lt;br /&gt;
**USB数据连接线  一根 &lt;br /&gt;
&lt;br /&gt;
==实验一==&lt;br /&gt;
&lt;br /&gt;
===使用MsTimer2库===&lt;br /&gt;
&lt;br /&gt;
*MsTimer2库下载地址：'''[[File:MsTimer2.zip]]'''&lt;br /&gt;
&lt;br /&gt;
*示例程序：&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// led灯接UNO的13管脚&lt;br /&gt;
#include &amp;lt;MsTimer2.h&amp;gt;               //定时器库的 头文件&lt;br /&gt;
&lt;br /&gt;
void flash()                        //中断处理函数，改变灯的状态&lt;br /&gt;
{                        &lt;br /&gt;
  static boolean output = HIGH;&lt;br /&gt;
  digitalWrite(13, output);&lt;br /&gt;
  output = !output;&lt;br /&gt;
}&lt;br /&gt;
void setup()&lt;br /&gt;
{&lt;br /&gt;
  pinMode(13, OUTPUT);&lt;br /&gt;
  MsTimer2::set(500, flash);        // 中断设置函数，每 500ms 进入一次中断&lt;br /&gt;
  MsTimer2::start();                //开始计时&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===结果===&lt;br /&gt;
led灯每500ms变化一次。&lt;br /&gt;
==实验二==&lt;br /&gt;
&lt;br /&gt;
===使用millis()函数===&lt;br /&gt;
&lt;br /&gt;
*示例程序&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
unsigned long ledOn=500,ledOff=500; //定义led灯变化的时间长度，每500ms变化一次&lt;br /&gt;
int ledStatus;                      //定义LED灯的状态，HIGH or LOWm&lt;br /&gt;
void setup()&lt;br /&gt;
{&lt;br /&gt;
	pinMode(13,OUTPUT);&lt;br /&gt;
	digitalWrite(13,HIGH);&lt;br /&gt;
	ledStatus=HIGH;&lt;br /&gt;
}&lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
    unsigned long nowtime=millis(); //获取当前的系统运行时间长度&lt;br /&gt;
    if(ledStatus==HIGH)             //如果当前lled灯状态为高电平，则执行该程序&lt;br /&gt;
    {&lt;br /&gt;
      if(nowtime&amp;gt;ledOn)             //检测系统运行时间长度是否到500ms&lt;br /&gt;
      {&lt;br /&gt;
        ledOn=nowtime;              //记录当前时间长度，第一次为500ms,赋值给ledOn&lt;br /&gt;
        ledOff=nowtime+500;         //计算出下一次led灯变化的时刻，第一次运行程序时应该在1000ms时关灯&lt;br /&gt;
        digitalWrite(13,LOW);       //关掉led灯&lt;br /&gt;
        ledStatus=LOW;              //记录当前led灯状态，下一次使用     &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
else{      &lt;br /&gt;
	if(nowtime&amp;gt;ledOff)&lt;br /&gt;
	{   &lt;br /&gt;
		ledOff=nowtime;&lt;br /&gt;
		ledOn=nowtime+500;&lt;br /&gt;
		digitalWrite(13,HIGH);&lt;br /&gt;
		ledStatus=HIGH;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===结果===&lt;br /&gt;
*使用mills()函数也能让led灯每500ms变化一次。&lt;br /&gt;
&lt;br /&gt;
*利用mills()函数同样可以实现中断的功能。mills()函数功能是获取系统运行的时间长度，单位ms。最大为9小时22分，如果超出时间将从0开始。函数的返回值为unsigned long型。&lt;br /&gt;
&lt;br /&gt;
*玩家可根据实际情况使用mills()函数，使用mills（）函数的好处在于占用的整个程序运行时间短，如果用用延时函数，在延时的时间内，CPU不能干别的事儿。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Pkj</name></author>	</entry>

	</feed>