<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Two. &#187; LEGO</title>
	<atom:link href="http://thetwo.cc/tag/lego/feed/" rel="self" type="application/rss+xml" />
	<link>http://thetwo.cc</link>
	<description>thoughts of everyday things</description>
	<lastBuildDate>Mon, 30 Jan 2012 05:56:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>用 LEGO NXT 做 Magic Wand 玩具原型</title>
		<link>http://thetwo.cc/2010/08/02/magic-wand-prototype-with-lego-nxt/</link>
		<comments>http://thetwo.cc/2010/08/02/magic-wand-prototype-with-lego-nxt/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 16:25:25 +0000</pubDate>
		<dc:creator>Xi Chen</dc:creator>
				<category><![CDATA[LEGO]]></category>
		<category><![CDATA[NXT]]></category>

		<guid isPermaLink="false">http://thetwo.cc/2010/08/02/magic-wand-prototype-with-lego-nxt/</guid>
		<description><![CDATA[每个周末都用半天做科学兴趣小组活动。这周照着这本超棒的书“Extreme NXT: Extending the LEGO MINDSTORMS NXT to the Next Level, Second Edition ”，做了个Magic Wand玩具的原型。 Magic Wand 玩具的最终效果是这样： 原理其实很简单，就是8个排列成行的LED灯按一定的模式闪烁，快速运动的时候，在不同的位置点亮完整单词在此位置需要的像素，看上去就是一个完整的单词了。 LEGO NXT内置的组件是无法做出这个玩具的。关键是需要一个I2C芯片 – PCF8574 （规格说明参考这里）。 根据“Extreme NXT”一书的提示，我们可以通过NXT的与PCF8574相连，扩展NXT的输出。下面的电路图就是用NXT与PCF8574控制一组8个LED灯的例子。Magic Wand也就是用的这个电路： 具体参数如下： Component Part Number Description Digi-Key U1 PCF8574 or PCF8574A I2C Digital Port 296-13109-5-ND D1–8 LED LED Bar Graph Display 160-1068-ND R1 and R2 82k 1/4 W 1% [...]]]></description>
			<content:encoded><![CDATA[<p>每个周末都用半天做科学兴趣小组活动。这周照着这本超棒的书“<a href="http://www.amazon.com/Extreme-NXT-Extending-MINDSTORMS-Technology/dp/1430224533/ref=dp_ob_title_bk" target="_blank">Extreme NXT: Extending the LEGO MINDSTORMS NXT to the Next Level, Second Edition</a> ”，做了个Magic Wand玩具的原型。</p>
<p>Magic Wand 玩具的最终效果是这样：</p>
<p><a href="http://thetwo.cc/wp-content/uploads/2010/08/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="image" border="0" alt="image" src="http://thetwo.cc/wp-content/uploads/2010/08/image_thumb.png" width="445" height="387" /></a></p>
<p>原理其实很简单，就是8个排列成行的LED灯按一定的模式闪烁，快速运动的时候，在不同的位置点亮完整单词在此位置需要的像素，看上去就是一个完整的单词了。</p>
<p>LEGO NXT内置的组件是无法做出这个玩具的。关键是需要一个I2C芯片 – PCF8574 （规格说明<a href="http://www.nxp.com/documents/data_sheet/PCF8574.pdf" target="_blank">参考这里</a>）。</p>
<p>根据“Extreme NXT”一书的提示，我们可以通过NXT的与PCF8574相连，扩展NXT的输出。下面的电路图就是用NXT与PCF8574控制一组8个LED灯的例子。Magic Wand也就是用的这个电路：</p>
<p><a href="http://thetwo.cc/wp-content/uploads/2010/08/image1.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="image" border="0" alt="image" src="http://thetwo.cc/wp-content/uploads/2010/08/image_thumb1.png" width="553" height="221" /></a></p>
<p>具体参数如下：</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="bottom">
<p><b>Component</b></p>
</td>
<td valign="bottom">
<p><b>Part Number</b></p>
</td>
<td valign="bottom">
<p><b>Description</b></p>
</td>
<td valign="bottom">
<p><b>Digi-Key</b></p>
</td>
</tr>
<tr>
<td valign="top">
<p>U1</p>
</td>
<td valign="top">
<p>PCF8574 or PCF8574A</p>
</td>
<td valign="top">
<p>I<sup>2</sup>C Digital Port</p>
</td>
<td valign="top">
<p>296-13109-5-ND</p>
</td>
</tr>
<tr>
<td valign="top">
<p>D1–8</p>
</td>
<td valign="top">
<p>LED</p>
</td>
<td valign="top">
<p>LED Bar Graph Display</p>
</td>
<td valign="top">
<p>160-1068-ND</p>
</td>
</tr>
<tr>
<td valign="top">
<p>R1 and R2</p>
</td>
<td valign="top">
<p>82k</p>
</td>
<td valign="top">
<p>1/4 W 1% Film Resistor</p>
</td>
<td valign="top">
<p>P82.0KCACT-ND</p>
</td>
</tr>
<tr>
<td valign="top">
<p>R3–R10</p>
</td>
<td valign="top">
<p>100Ω</p>
</td>
<td valign="top">
<p>1/4 W 1% Film Resistor</p>
</td>
<td valign="top">
<p>P150CACT-ND or P100CACT-ND</p>
</td>
</tr>
</tbody>
</table>
<p>在闺蜜白老师的陪伴下，去知春路电子市场买了PCF8574和LED以及电阻，另外还借了白老师的电烙铁（感谢白老师！）这周六的下午躲在厨房里做好了板子，一次成功！（其中，入口和PCF是白老师上星期弄上去的）</p>
<p>正面：</p>
<p><a href="http://thetwo.cc/wp-content/uploads/2010/08/IMG_2917.jpg"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="IMG_2917" border="0" alt="IMG_2917" src="http://thetwo.cc/wp-content/uploads/2010/08/IMG_2917_thumb.jpg" width="644" height="431" /></a></p>
<p>因为我大学期间的电子课程差点不及格，我就不介绍细节了（等我搞清楚了再说），但这个电路从操作上非常简单：你只要用一条NXT命令向PCF8574发送一个数，这个数换成二进制后的前8位就会对应这8盏LED，1就是灭，0就是亮。所以，上图中就是发送一个0的结果。</p>
<p>背面：（很丑，所以这叫“原型”）</p>
<p><a href="http://thetwo.cc/wp-content/uploads/2010/08/IMG_2919.jpg"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="IMG_2919" border="0" alt="IMG_2919" src="http://thetwo.cc/wp-content/uploads/2010/08/IMG_2919_thumb.jpg" width="644" height="431" /></a></p>
<p>接上NXT之后，人工晃动的效果：</p>
<p><a href="http://thetwo.cc/wp-content/uploads/2010/08/IMG_2924.jpg"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="IMG_2924" border="0" alt="IMG_2924" src="http://thetwo.cc/wp-content/uploads/2010/08/IMG_2924_thumb.jpg" width="644" height="431" /></a></p>
<p>原型算是做好了。下一步要把这个做小，能够嵌到LEGO的积木上，真正搭出一个自动的Magic Wand。这会比做原型化费更多的时间，所以不知道什么时候能做好。就像我不知道什么时候能把克林贡语词典翻译完一样。（干，我最近回过头去看，翻译的好烂。。）</p>
<p>总结：</p>
<ul>
<li><a href="http://www.amazon.com/Extreme-NXT-Extending-MINDSTORMS-Technology/dp/1590598180" target="_blank">Extreme NXT</a> 真是一本好酷好酷的书！</li>
<li>每周的陈老师科学兴趣小组应该持续不断地进行下去！</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://thetwo.cc/2010/08/02/magic-wand-prototype-with-lego-nxt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NXT 自制传感器第一步：Touching Wires</title>
		<link>http://thetwo.cc/2010/06/17/nxt-homebrew-1/</link>
		<comments>http://thetwo.cc/2010/06/17/nxt-homebrew-1/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 15:48:04 +0000</pubDate>
		<dc:creator>Xi Chen</dc:creator>
				<category><![CDATA[LEGO]]></category>
		<category><![CDATA[NXT]]></category>

		<guid isPermaLink="false">http://thetwo.cc/2010/06/17/nxt-%e8%87%aa%e5%88%b6%e4%bc%a0%e6%84%9f%e5%99%a8%e7%ac%ac%e4%b8%80%e6%ad%a5%ef%bc%9atouching-wires/</guid>
		<description><![CDATA[用了最取巧的连接方法：买了额外的数据线，然后从中间剪断，抽出6根Pin线。 最简单的玩法就是，黑线搭白线，传递的信号与LEGO的接触传感器一致。 其中，白线（Pin-1）可以做模拟信号输入（0到5V电压），或作为9V电源。黑线（Pin-2）是地线。 LEGO有个10位的转换器，可以把模拟信号转换成0到1023之间的数字值。每3毫秒采样一次。 补充一下这个传感器的原理： NXT Pin-1 和 Pin-2 与模拟数字转换器的接线： 打开时，电压为5V，接通时，电压为0V： 如果电压值小于 (5*460/1023)V，NXT就认为是接触上的。]]></description>
			<content:encoded><![CDATA[<p>用了最取巧的连接方法：买了额外的数据线，然后从中间剪断，抽出6根Pin线。</p>
<p>最简单的玩法就是，黑线搭白线，传递的信号与LEGO的接触传感器一致。</p>
<p><img src="http://thetwo.cc/wp-content/uploads/2010/06/061710_1547_NXTTo11.jpg" alt="" /></p>
<p>其中，白线（Pin-1）可以做模拟信号输入（0到5V电压），或作为9V电源。黑线（Pin-2）是地线。</p>
<p>LEGO有个10位的转换器，可以把模拟信号转换成0到1023之间的数字值。每3毫秒采样一次。</p>
<p>补充一下这个传感器的原理：</p>
<p>NXT Pin-1 和 Pin-2 与模拟数字转换器的接线：</p>
<p><a href="http://thetwo.cc/wp-content/uploads/2010/06/image.png"><img style="display: inline; border: 0px;" title="image" src="http://thetwo.cc/wp-content/uploads/2010/06/image_thumb.png" border="0" alt="image" width="350" height="185" /></a></p>
<p>打开时，电压为5V，接通时，电压为0V：</p>
<p><a href="http://thetwo.cc/wp-content/uploads/2010/06/image1.png"><img style="display: inline; border: 0px;" title="image" src="http://thetwo.cc/wp-content/uploads/2010/06/image_thumb1.png" border="0" alt="image" width="553" height="181" /></a></p>
<p>如果电压值小于 (5*460/1023)V，NXT就认为是接触上的。</p>
]]></content:encoded>
			<wfw:commentRss>http://thetwo.cc/2010/06/17/nxt-homebrew-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LEGO NXT2.0 Color Sorter Sample</title>
		<link>http://thetwo.cc/2010/06/07/lego-nxt2-0-color-sorter-sample/</link>
		<comments>http://thetwo.cc/2010/06/07/lego-nxt2-0-color-sorter-sample/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 16:14:18 +0000</pubDate>
		<dc:creator>Xi Chen</dc:creator>
				<category><![CDATA[the good the bad the ugly]]></category>
		<category><![CDATA[LEGO]]></category>

		<guid isPermaLink="false">http://thetwo.cc/?p=93</guid>
		<description><![CDATA[和白老师还有关键照着手册做的。准备拆掉了。立此存照。]]></description>
			<content:encoded><![CDATA[<p>和白老师还有关键照着手册做的。准备拆掉了。立此存照。</p>
<p><object style="width: 400px; height: 300px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://player.youku.com/player.php/sid/XMTc5NDEwMDE2/v.swf" /><embed style="width: 400px; height: 300px;" type="application/x-shockwave-flash" width="400" height="300" src="http://player.youku.com/player.php/sid/XMTc5NDEwMDE2/v.swf"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://thetwo.cc/2010/06/07/lego-nxt2-0-color-sorter-sample/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

