<?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=%E8%87%AA%E5%8A%A8%E6%84%9F%E5%BA%94%E9%97%A81</id>
		<title>自动感应门1 - 版本历史</title>
		<link rel="self" type="application/atom+xml" href="http:///https//wiki.microduino.cn/index.php?action=history&amp;feed=atom&amp;title=%E8%87%AA%E5%8A%A8%E6%84%9F%E5%BA%94%E9%97%A81"/>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=%E8%87%AA%E5%8A%A8%E6%84%9F%E5%BA%94%E9%97%A81&amp;action=history"/>
		<updated>2026-06-13T12:37:19Z</updated>
		<subtitle>本wiki的该页面的版本历史</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=%E8%87%AA%E5%8A%A8%E6%84%9F%E5%BA%94%E9%97%A81&amp;diff=20826&amp;oldid=prev</id>
		<title>Zhangfengfeng：/* 模块清单 */</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=%E8%87%AA%E5%8A%A8%E6%84%9F%E5%BA%94%E9%97%A81&amp;diff=20826&amp;oldid=prev"/>
				<updated>2017-06-13T03:48:50Z</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;2017年6月13日 (二) 03:48的版本&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-l27&quot; &gt;第27行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第27行：&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;|[[Sensor-Servo Connector/zh|舵机转接板]]||1||舵机转接板&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;|[[Sensor-Servo Connector/zh|舵机转接板]]||1||舵机转接板&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;|[[Sensor-Line Finder/zh|&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;红外反射传感器&lt;/del&gt;]]||2||检测物体&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;|[[Sensor-Line Finder/zh|&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;灰度传感器&lt;/ins&gt;]]||2||检测物体&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>Zhangfengfeng</name></author>	</entry>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=%E8%87%AA%E5%8A%A8%E6%84%9F%E5%BA%94%E9%97%A81&amp;diff=18198&amp;oldid=prev</id>
		<title>Yanglibin@microduino.cc：创建页面，内容为“{| style=&quot;width: 1000px;&quot; |- |  ==概述== center  做一个自动感应门，用两个红外反射传感器检测有人靠近...”</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=%E8%87%AA%E5%8A%A8%E6%84%9F%E5%BA%94%E9%97%A81&amp;diff=18198&amp;oldid=prev"/>
				<updated>2016-10-17T02:57:47Z</updated>
		
		<summary type="html">&lt;p&gt;创建页面，内容为“{| style=&amp;quot;width: 1000px;&amp;quot; |- |  ==概述== &lt;a href=&quot;/index.php/%E6%96%87%E4%BB%B6:Anywhere_line_door.jpg&quot; title=&quot;文件:Anywhere line door.jpg&quot;&gt;600px|center&lt;/a&gt;  做一个自动感应门，用两个红外反射传感器检测有人靠近...”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{| style=&amp;quot;width: 1000px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
==概述==&lt;br /&gt;
[[File:anywhere_line_door.jpg|600px|center]]&lt;br /&gt;
&lt;br /&gt;
做一个自动感应门，用两个红外反射传感器检测有人靠近，舵机控制开门。&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
适合套件：mCookie302&lt;br /&gt;
&lt;br /&gt;
&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;
|[[mCookie-Core/zh|mCookie-Core]]||1||核心板&lt;br /&gt;
|-&lt;br /&gt;
|[[mCookie-Battery|电池盒]]||1||程序下载和供电模块&lt;br /&gt;
|-&lt;br /&gt;
|[[mCookie-Hub/zh|mCookie-Hub]]||1||传感器转接板&lt;br /&gt;
|-&lt;br /&gt;
|[[舵机]]||1||舵机&lt;br /&gt;
|-&lt;br /&gt;
|[[Sensor-Servo Connector/zh|舵机转接板]]||1||舵机转接板&lt;br /&gt;
|-&lt;br /&gt;
|[[Sensor-Line Finder/zh|红外反射传感器]]||2||检测物体&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===其他设备===&lt;br /&gt;
*USB数据线*1&lt;br /&gt;
*传感器连接线*3&lt;br /&gt;
*传感器外壳&lt;br /&gt;
*乐高或其它固定结构&lt;br /&gt;
[[File:anywhere_don't touch me－module.jpg|600px|center]]&lt;br /&gt;
&lt;br /&gt;
==模块搭建==&lt;br /&gt;
===搭建===&lt;br /&gt;
[[File:anywhere_don't touch me－step.jpg|600px|center]]&lt;br /&gt;
*将模块和传感器组装起来：&lt;br /&gt;
**将红色的核心模块，电池底座与绿色的扩展模块吸在一起；&lt;br /&gt;
**将舵机转接板连接在Hub的6/7管脚；&lt;br /&gt;
**将舵机连接在舵机转接板的1管脚（下面三个插针）；&lt;br /&gt;
**将红外反射传感器连接在Hub的A0/A1、A2/A3管脚。&lt;br /&gt;
**将USB连接线一端插入电池底座，另一端连接电脑；&lt;br /&gt;
==编程==&lt;br /&gt;
===使用的程序块===&lt;br /&gt;
*[[“如果－执行”程序块]]&lt;br /&gt;
*[[“如果－否则”程序块]]&lt;br /&gt;
*[[“否则如果”程序块]]&lt;br /&gt;
*[[“变量声明”、“变量赋值”程序块]]&lt;br /&gt;
*[[“红外反射传感器”程序块]]&lt;br /&gt;
*[[“计算”程序块]]&lt;br /&gt;
*[[“比较”程序块]]&lt;br /&gt;
*[[“舵机”程序块]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===编程思路===&lt;br /&gt;
自动门内外两侧分别检测距离，A或B的距离小于790（任何一侧有人接近），自动开门，同时延时2秒等待行人通过。A和B的距离均大于800（门两侧都没人）则关门。&lt;br /&gt;
[[File:mixly-ctrl-line_door.jpg|600px|center]]&lt;br /&gt;
&lt;br /&gt;
===开始编程===&lt;br /&gt;
'''1、读取两个红外反射传感器距离并存储'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
变量A用来存储一侧红外反射传感器的值，变量B用来存储另一侧红外反射传感器的值，将A2管脚红外反射传感器的值存入变量A，将A0管脚红外反射传感器的值存入变量B。&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:mixly-ctrl-line_door－code.jpg|600px|center]]&lt;br /&gt;
'''2、判断任意一侧有人接近则开门'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
A或B的距离小于790（任何一侧有人接近）。&lt;br /&gt;
舵机转到10度，速度50度/秒（慢慢开门）。&lt;br /&gt;
延时2秒等待行人通过。&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:mixly-ctrl-line_door－code1.jpg|600px|center]]&lt;br /&gt;
'''3、判断两侧都没人则关门'''&lt;br /&gt;
A和B的距离均大于800（门两侧都没人）。&lt;br /&gt;
舵机转到170度，速度50度/秒（慢慢关门）。&lt;br /&gt;
[[File:mixly-ctrl-line_door－code2.jpg|600px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''测试结果'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
当没有人靠近门口时，舵机处于关门状态；有人靠近门口时，舵机转为开门状态。&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
将两个红外反射传感器分别安装在门的两侧，用乐高搭建自动门外型。铁丝固定在舵机摇臂上，摇臂转到170度时关门,摇臂转动到10度时开门。    &lt;br /&gt;
[[File:anywhere_line_door.jpg|600px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Q:有个问题？如果人恰好站在门框里，传感器是探测不到的，这时关门会夹到人，能不能加个关门提醒呢？'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''A:可以呀，用蜂鸣器或者灯都能提醒。'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''声明及赋值，有人接近，舵机控制开门'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
彩灯准备。&lt;br /&gt;
door变量用来记录门的开闭状态。&lt;br /&gt;
door赋值为1（门开了）。&lt;br /&gt;
[[File:mixly-ctrl-don't touch me－code3.jpg|600px|center]]&lt;br /&gt;
'''门两侧没人，关门并点亮关门指示灯'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
如果door等于1（门是开着的）则执行内部程序。&lt;br /&gt;
door赋值为0（门关了）。&lt;br /&gt;
红灯闪烁3次（关门前提醒）。&lt;br /&gt;
[[File:mixly-ctrl-don't touch me－code4.jpg|600px|center]]&lt;br /&gt;
==技术规范==&lt;br /&gt;
*红外反射详细参考[[Sensor-Line Finder/zh]]&lt;br /&gt;
*舵机详细参考[[舵机]]&lt;br /&gt;
&lt;br /&gt;
==相关案例==&lt;br /&gt;
*'''[[能量护盾]]'''&lt;br /&gt;
*'''[[自动分拣机]]'''&lt;br /&gt;
*'''[[跷跷板]]'''&lt;br /&gt;
*'''[[招财猫]]'''&lt;br /&gt;
*'''[[点球大战]]'''&lt;br /&gt;
*'''[[别摸我！摇摆机器人]]'''&lt;br /&gt;
==Q&amp;amp;A==&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Yanglibin@microduino.cc</name></author>	</entry>

	</feed>