<?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=%E6%99%BA%E8%83%BD%E6%8F%92%E5%BA%A7</id>
		<title>智能插座 - 版本历史</title>
		<link rel="self" type="application/atom+xml" href="http:///https//wiki.microduino.cn/index.php?action=history&amp;feed=atom&amp;title=%E6%99%BA%E8%83%BD%E6%8F%92%E5%BA%A7"/>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=%E6%99%BA%E8%83%BD%E6%8F%92%E5%BA%A7&amp;action=history"/>
		<updated>2026-04-22T08:54:26Z</updated>
		<subtitle>本wiki的该页面的版本历史</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=%E6%99%BA%E8%83%BD%E6%8F%92%E5%BA%A7&amp;diff=16779&amp;oldid=prev</id>
		<title>Radiumray9@gmail.com：/* 调试过程 */</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=%E6%99%BA%E8%83%BD%E6%8F%92%E5%BA%A7&amp;diff=16779&amp;oldid=prev"/>
				<updated>2016-08-30T01:33:01Z</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;2016年8月30日 (二) 01: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-l77&quot; &gt;第77行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第77行：&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;*手机端APP&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;*手机端APP&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;首先使用手机扫描二维码，下载蓝牙App，下载完成后打开&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;首先使用手机扫描二维码，下载蓝牙App，下载完成后打开&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;[[File:zhinengchazuo.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;apk&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;[[File:zhinengchazuo.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;rar&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;[[File:Chazuo2d.jpg||300px|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:Chazuo2d.jpg||300px|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;div&gt;点击SCAN，搜索周围蓝牙设备，发现并点击Microduino&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;点击SCAN，搜索周围蓝牙设备，发现并点击Microduino&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=%E6%99%BA%E8%83%BD%E6%8F%92%E5%BA%A7&amp;diff=16778&amp;oldid=prev</id>
		<title>Radiumray9@gmail.com：/* 调试过程 */</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=%E6%99%BA%E8%83%BD%E6%8F%92%E5%BA%A7&amp;diff=16778&amp;oldid=prev"/>
				<updated>2016-08-30T01:30:49Z</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;2016年8月30日 (二) 01:30的版本&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-l77&quot; &gt;第77行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第77行：&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;*手机端APP&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;*手机端APP&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;首先使用手机扫描二维码，下载蓝牙App，下载完成后打开&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;首先使用手机扫描二维码，下载蓝牙App，下载完成后打开&lt;/div&gt;&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;[[File:zhinengchazuo.apk]]&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;[[File:Chazuo2d.jpg||300px|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:Chazuo2d.jpg||300px|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;div&gt;点击SCAN，搜索周围蓝牙设备，发现并点击Microduino&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;点击SCAN，搜索周围蓝牙设备，发现并点击Microduino&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-l84&quot; &gt;第84行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第85行：&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;点击屏幕中间的按钮开关就可以控制智能插座的通断了,同时插座上的按键也可以控制插座的通断，手机APP上可以实时同步开关的状态&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;点击屏幕中间的按钮开关就可以控制智能插座的通断了,同时插座上的按键也可以控制插座的通断，手机APP上可以实时同步开关的状态&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:Chazuoandroid3.jpg||300px|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:Chazuoandroid3.jpg||300px|center|thumb]]&lt;/div&gt;&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;&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;*与电接触很危险，注意用电安全！一切安装操作都不能接电！安装好接电后就算智能插座是关闭状态，也一定不要触摸电源插口！&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=%E6%99%BA%E8%83%BD%E6%8F%92%E5%BA%A7&amp;diff=10517&amp;oldid=prev</id>
		<title>2015年10月13日 (二) 09:25 502748957@qq.com</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=%E6%99%BA%E8%83%BD%E6%8F%92%E5%BA%A7&amp;diff=10517&amp;oldid=prev"/>
				<updated>2015-10-13T09:25:58Z</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年10月13日 (二) 09:25的版本&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-l9&quot; &gt;第9行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第9行：&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;*简介:&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-BT]]）并发送命令、接收电路状态，核心控制模块（[[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;智能插座主要由控制模块和电路部分组成，用户可以使用手机连接蓝牙模块（[[Microduino-BT&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;/zh&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;&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:123.png||300px|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:123.png||300px|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;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 colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l39&quot; &gt;第39行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第39行：&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;==实验原理==&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;[[File:Chazuotheory.jpg||&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;300px&lt;/del&gt;|center|thumb]]&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;[[File:Chazuotheory.jpg||&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;500px&lt;/ins&gt;|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;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;智能插座的电源控制分为两部分，分别是电压转换和继电器控制两部分。&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 colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l46&quot; &gt;第46行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第46行：&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;本套件使用了蓝牙无线通信模块Microduino-BT，由于Microduino的蓝牙模块很好的屏蔽了底层的协议，所以关于蓝牙协议这里不再赘述，使用它只需确认蓝牙串口的接法，默认是D2，D3。，给出一张蓝牙通讯所使用的串口图，所有的串口连接方法都涵盖在该图中：&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-BT，由于Microduino的蓝牙模块很好的屏蔽了底层的协议，所以关于蓝牙协议这里不再赘述，使用它只需确认蓝牙串口的接法，默认是D2，D3。，给出一张蓝牙通讯所使用的串口图，所有的串口连接方法都涵盖在该图中：&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;[[File:Microduino-BT-2Big1.jpg||&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;300px&lt;/del&gt;|center|thumb]]&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;[[File:Microduino-BT-2Big1.jpg||&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;600px&lt;/ins&gt;|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;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-BT]]&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;[[Microduino-BT&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;&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;/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;/table&gt;</summary>
		<author><name>502748957@qq.com</name></author>	</entry>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=%E6%99%BA%E8%83%BD%E6%8F%92%E5%BA%A7&amp;diff=10516&amp;oldid=prev</id>
		<title>502748957@qq.com：Created page with &quot;{| style=&quot;width: 800px;&quot; |- | ==概述== *项目名称：Microduino智能插座 *目的：手机控制插座通断 *难度：低 *耗时：2小时 *制作者： *简介: 智...&quot;</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=%E6%99%BA%E8%83%BD%E6%8F%92%E5%BA%A7&amp;diff=10516&amp;oldid=prev"/>
				<updated>2015-10-13T09:16:14Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;{| style=&amp;quot;width: 800px;&amp;quot; |- | ==概述== *项目名称：Microduino智能插座 *目的：手机控制插座通断 *难度：低 *耗时：2小时 *制作者： *简介: 智...&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;
==概述==&lt;br /&gt;
*项目名称：Microduino智能插座&lt;br /&gt;
*目的：手机控制插座通断&lt;br /&gt;
*难度：低&lt;br /&gt;
*耗时：2小时&lt;br /&gt;
*制作者：&lt;br /&gt;
*简介:&lt;br /&gt;
智能插座主要由控制模块和电路部分组成，用户可以使用手机连接蓝牙模块（[[Microduino-BT]]）并发送命令、接收电路状态，核心控制模块（[[Microduino-Core]]）对数据进行分析之后控制继电器对电路进行控制。&lt;br /&gt;
[[File:123.png||300px|center|thumb]]&lt;br /&gt;
==材料清单==&lt;br /&gt;
*Microduino设备&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|模块||数量||功能&lt;br /&gt;
|-&lt;br /&gt;
|[[Microduino-Core/zh]]||1||核心板&lt;br /&gt;
|-&lt;br /&gt;
|[[Microduino-USBTTL/zh]] ||1||下载程序&lt;br /&gt;
|-&lt;br /&gt;
|[[Microduino-BT/zh]] ||1||蓝牙通信&lt;br /&gt;
|}&lt;br /&gt;
*其他设备&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|模块||数量||功能&lt;br /&gt;
|-&lt;br /&gt;
|底壳+电路板||1||核心板&lt;br /&gt;
|-&lt;br /&gt;
|外壳||1||下载程序&lt;br /&gt;
|-&lt;br /&gt;
|长螺丝 ||1||固定外壳与底壳&lt;br /&gt;
|-&lt;br /&gt;
|短螺丝 ||1||固定底壳与电路板&lt;br /&gt;
|-&lt;br /&gt;
|M3螺丝刀 ||1||拧螺丝&lt;br /&gt;
|}&lt;br /&gt;
==实验原理==&lt;br /&gt;
[[File:Chazuotheory.jpg||300px|center|thumb]]&lt;br /&gt;
*电路控制原理&lt;br /&gt;
智能插座的电源控制分为两部分，分别是电压转换和继电器控制两部分。&lt;br /&gt;
首先介绍一下电压转换部分，由于家庭中的电源多为220伏特的交流电，而Microduino-Core工作在5伏特的直流电压环境下，这部分的功能就如同一个变压器，像手机的充电插头一样转换了电压。&lt;br /&gt;
另一部分是继电器控制，继电器是当输入电压的变化达到规定要求时，在电气输出电路中使被控量发生预定的阶跃变化的一种电器。它具有控制系统（又称输入回路）和被控制系统（又称输出回路）之间的互动关系。通常应用于自动化的控制电路中，它实际上是用小电流去控制大电流运作的一种“自动开关”。故在电路中起着自动调节、安全保护、转换电路等作用。由于Microduino-Core核心控制引脚输出的电压很小，不能直接给电器供电，因此需要通过控制继电器从而间接控制家庭电源。&lt;br /&gt;
*无线通信原理&lt;br /&gt;
本套件使用了蓝牙无线通信模块Microduino-BT，由于Microduino的蓝牙模块很好的屏蔽了底层的协议，所以关于蓝牙协议这里不再赘述，使用它只需确认蓝牙串口的接法，默认是D2，D3。，给出一张蓝牙通讯所使用的串口图，所有的串口连接方法都涵盖在该图中：&lt;br /&gt;
[[File:Microduino-BT-2Big1.jpg||300px|center|thumb]]&lt;br /&gt;
*主要器件&lt;br /&gt;
[[Microduino-BT]]&lt;br /&gt;
==文档==&lt;br /&gt;
&lt;br /&gt;
==调试过程==&lt;br /&gt;
*程序下载&lt;br /&gt;
将Microduino Core、Microduino USBTTL堆叠在一起.用数据线将写好的程序通过Microduino USBTTL上传到Microduino Core上。&lt;br /&gt;
注意：最好不要将所有模块堆叠在一起之后再上传程序&lt;br /&gt;
[[File:download1.jpg||300px|center|thumb]]&lt;br /&gt;
打开Aroduino IDE，若电脑中没有安装，则参照附录中的安装方法，先安装Aicroduino IDE。点击左上【文件】选项→点击【打开】。&lt;br /&gt;
[[File:Bleopen.jpg||300px|center|thumb]]&lt;br /&gt;
在弹出的对话框中找到MicroduinoBluControlOutlet.ino并双击打开&lt;br /&gt;
[[File:bluecontrol.jpg||300px|center|thumb]]&lt;br /&gt;
之后点击左上角的&amp;quot;√&amp;quot;进行编译，点击上边栏的工具，确认板卡（Microduino-Core）处理器（Atmega328P@16M,5V）和端口号(COMX)。三项都如图确认无误之后点击&amp;quot;→&amp;quot;按钮下载程序到开发板上&lt;br /&gt;
[[File:Chooseboard.jpg||300px|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
*搭建&lt;br /&gt;
先使用三个4mm螺丝将电路板固定在底壳上&lt;br /&gt;
[[File:Chazuo1.jpg||300px|center|thumb]]&lt;br /&gt;
将Microduino-BT与Microduino-Core插接好并插接在智能插座的底板上&lt;br /&gt;
[[File:Chazuo2.jpg||300px|center|thumb]]&lt;br /&gt;
将智能插座外壳扣入底壳并使用8mm长螺丝旋入，固定上下外壳，至此智能插座部分搭建完成&lt;br /&gt;
[[File:Chazuo3.jpg||300px|center|thumb]]&lt;br /&gt;
将智能插座插入家中的插座。手机充电器插在智能插座上，并按下开关钮，可以看到指示灯亮起，手机开始充电。调试智能插座。图中：&lt;br /&gt;
①为开关按钮&lt;br /&gt;
②是上电指示灯&lt;br /&gt;
③是智能插座通断指示灯&lt;br /&gt;
[[File:Chazuo4.jpg||300px|center|thumb]]&lt;br /&gt;
*手机端APP&lt;br /&gt;
首先使用手机扫描二维码，下载蓝牙App，下载完成后打开&lt;br /&gt;
[[File:Chazuo2d.jpg||300px|center|thumb]]&lt;br /&gt;
点击SCAN，搜索周围蓝牙设备，发现并点击Microduino&lt;br /&gt;
[[File:Chazuoandroid1.jpg||300px|center|thumb]]&lt;br /&gt;
等待1-2秒，待屏幕上出现ready字样可以开始操作智能插座&lt;br /&gt;
[[File:Chazuoandroid2.jpg||300px|center|thumb]]&lt;br /&gt;
点击屏幕中间的按钮开关就可以控制智能插座的通断了,同时插座上的按键也可以控制插座的通断，手机APP上可以实时同步开关的状态&lt;br /&gt;
[[File:Chazuoandroid3.jpg||300px|center|thumb]]&lt;br /&gt;
==注意问题==&lt;br /&gt;
*与电接触很危险，注意用电安全！一切安装操作都不能接电！安装好接电后就算智能插座是关闭状态，也一定不要触摸电源插口！&lt;br /&gt;
*如果蓝牙采用了蓝牙原理图中的Serial10跳线法，在用Microduino-Core和Microduino-USBTTL组合烧录程序时，不要将蓝牙模块也叠上去，会引起串口冲突，正确的做法是将程序烧录完毕后，拔下Microduino-USBTTL，再将蓝牙与Microduino-Core模块叠放在插座底板上。&lt;br /&gt;
==程序说明==&lt;br /&gt;
*主程序&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;key.h&amp;quot; &lt;br /&gt;
 &lt;br /&gt;
#include &amp;lt;SoftwareSerial.h&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
#define outletPin 6    //显示当前的开关状态 &lt;br /&gt;
#define led_Pin 5     //自定义引脚 &lt;br /&gt;
#define Button_Pin 4    //这个引脚用于控制智能插座的开关 &lt;br /&gt;
 &lt;br /&gt;
SoftwareSerial mySerial(2, 3); //RX,TX &lt;br /&gt;
 &lt;br /&gt;
#define my_Serial mySerial &lt;br /&gt;
//#define my_Serial Serial1 当所用核心模块是Core+时启用这句并注释掉上一句程序 &lt;br /&gt;
 &lt;br /&gt;
String tmp = &amp;quot;&amp;quot;; &lt;br /&gt;
 &lt;br /&gt;
boolean swith, change; &lt;br /&gt;
 &lt;br /&gt;
void setup() &lt;br /&gt;
{ &lt;br /&gt;
    Serial.begin(9600);     //定义串口频率 &lt;br /&gt;
    Serial.println(&amp;quot;LEDOnOff Starting...&amp;quot;); &lt;br /&gt;
    my_Serial.begin(9600); &lt;br /&gt;
    //定义引脚的输入输出状态 &lt;br /&gt;
    pinMode(outletPin, OUTPUT); &lt;br /&gt;
    pinMode(led_Pin, OUTPUT); &lt;br /&gt;
    pinMode(Button_Pin, INPUT_PULLUP); &lt;br /&gt;
//初始化状态提示灯亮，插座开关提示灯灭&lt;br /&gt;
    digitalWrite(outletPin, LOW); &lt;br /&gt;
    digitalWrite(led_Pin, HIGH); &lt;br /&gt;
 &lt;br /&gt;
    key_init();   //初始化电平控制数组 &lt;br /&gt;
} &lt;br /&gt;
 &lt;br /&gt;
void loop() &lt;br /&gt;
{ &lt;br /&gt;
    // 如果串口有数据就读取串口中的数据，串口每次传输一个字符，因此要进行转换 &lt;br /&gt;
    while (my_Serial.available() &amp;gt; 0) &lt;br /&gt;
    { &lt;br /&gt;
 &lt;br /&gt;
        tmp += char(my_Serial.read()); &lt;br /&gt;
        delay(2); &lt;br /&gt;
    } &lt;br /&gt;
    //如果从串口中读取的内容不为空，进行状态判断 &lt;br /&gt;
    if (tmp.length() &amp;gt; 0) &lt;br /&gt;
    { &lt;br /&gt;
        if(tmp == &amp;quot;on&amp;quot;)      //如果收到的内容为on &lt;br /&gt;
        { &lt;br /&gt;
            Serial.println(&amp;quot;power on&amp;quot;);  //串口显示：上电 &lt;br /&gt;
            digitalWrite(outletPin, HIGH); //将开关指示灯点亮 &lt;br /&gt;
            swith = true; &lt;br /&gt;
        } &lt;br /&gt;
        else if(tmp == &amp;quot;off&amp;quot;)  //如果收到的内容为off &lt;br /&gt;
        { &lt;br /&gt;
            digitalWrite(outletPin, LOW); //关闭开关指示灯 &lt;br /&gt;
            Serial.println(&amp;quot;power off&amp;quot;);//串口显示：关闭 &lt;br /&gt;
            swith = false; &lt;br /&gt;
        } &lt;br /&gt;
        tmp = &amp;quot;&amp;quot;; &lt;br /&gt;
    } &lt;br /&gt;
 &lt;br /&gt;
    if(key_get(Button_Pin, 0)) //用于物理按钮,当每次按键按下并松开后 &lt;br /&gt;
    { &lt;br /&gt;
        delay(300); &lt;br /&gt;
        swith = !swith; //翻转开关状态 &lt;br /&gt;
    } &lt;br /&gt;
 &lt;br /&gt;
    if(change != swith) //如果开关状态有变化 &lt;br /&gt;
    { &lt;br /&gt;
        change = swith; //用change记录本次操作的开关状态 &lt;br /&gt;
        if(swith)   //如果是开状态 &lt;br /&gt;
        { &lt;br /&gt;
            digitalWrite(outletPin, HIGH); //点亮指示灯 &lt;br /&gt;
            my_Serial.println(&amp;quot;ON&amp;quot;);     //告知蓝牙模块开启智能插座 &lt;br /&gt;
        } &lt;br /&gt;
        else &lt;br /&gt;
        { &lt;br /&gt;
            digitalWrite(outletPin, LOW);  //关闭指示灯 &lt;br /&gt;
            my_Serial.println(&amp;quot;OFF&amp;quot;);     //告知蓝牙模块关闭智能插座 &lt;br /&gt;
        } &lt;br /&gt;
    } &lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*key.h&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;arduino.h&amp;quot; &lt;br /&gt;
 &lt;br /&gt;
boolean key[NUM_DIGITAL_PINS];            //当前按键状态 &lt;br /&gt;
boolean key_cache[NUM_DIGITAL_PINS];        //上一次的按键状态缓存 &lt;br /&gt;
 &lt;br /&gt;
void key_init() &lt;br /&gt;
//将所有数字引脚当前状态设为低电平，缓存电平设为高电平，便于之后的电平翻转设计 &lt;br /&gt;
{ &lt;br /&gt;
    for(int a = 0; a &amp;lt; NUM_DIGITAL_PINS; a++) &lt;br /&gt;
    { &lt;br /&gt;
        key[a] = LOW; &lt;br /&gt;
        key_cache[a] = HIGH; &lt;br /&gt;
    } &lt;br /&gt;
} &lt;br /&gt;
 &lt;br /&gt;
boolean key_get(int _key_pin, boolean _key_type) &lt;br /&gt;
//这个函数是为了插座上的物理按钮设计的 &lt;br /&gt;
//第一个参数为引脚号，第二个参数为模式选择，因为只判断按键松开所以只用到了0模式 &lt;br /&gt;
 &lt;br /&gt;
{ &lt;br /&gt;
    key_cache[_key_pin] = key[_key_pin];        //缓存作判断用 &lt;br /&gt;
 &lt;br /&gt;
    key[_key_pin] = !digitalRead(_key_pin); &lt;br /&gt;
    //按钮按下为低电平，松开为高电平 &lt;br /&gt;
    //这里是翻转一下为了逻辑true表述通电 &lt;br /&gt;
    switch(_key_type) &lt;br /&gt;
    { &lt;br /&gt;
    case 0: &lt;br /&gt;
        //没有按钮输入时key和key_cache都是LOW状态，当按下按钮后的第一个loop &lt;br /&gt;
        //keycache还是LOW但是key变为HIGH，之后的循环两者都变为HIGH，直到松开按钮 &lt;br /&gt;
        //的第一个loop，key_cache得到key的HIGH状态，key变为LOW，case0这个判断就是 &lt;br /&gt;
        //找这个松开按键的状态 &lt;br /&gt;
        if(!key[_key_pin] &amp;amp;&amp;amp; key_cache[_key_pin]) &lt;br /&gt;
            return true; &lt;br /&gt;
        else &lt;br /&gt;
            return false; &lt;br /&gt;
        break; &lt;br /&gt;
    case 1: &lt;br /&gt;
        if(key[_key_pin] &amp;amp;&amp;amp; !key_cache[_key_pin])        //按下松开后 &lt;br /&gt;
            return true; &lt;br /&gt;
        else &lt;br /&gt;
            return false; &lt;br /&gt;
        break; &lt;br /&gt;
    } &lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
==视频==&lt;/div&gt;</summary>
		<author><name>502748957@qq.com</name></author>	</entry>

	</feed>