<?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>Dangerous Prototypes &#187; Wii nunchuck</title>
	<atom:link href="http://dangerousprototypes.com/tag/wii-nunchuck/feed/" rel="self" type="application/rss+xml" />
	<link>http://dangerousprototypes.com</link>
	<description>A new open source hardware project every month</description>
	<lastBuildDate>Wed, 08 Sep 2010 09:14:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Bus Pirate: Wii Nunchuck quick guide</title>
		<link>http://dangerousprototypes.com/2009/08/19/bus-pirate-wii-nunchuck-quick-guide/</link>
		<comments>http://dangerousprototypes.com/2009/08/19/bus-pirate-wii-nunchuck-quick-guide/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 13:17:53 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[Bus Pirate]]></category>
		<category><![CDATA[accelerometer]]></category>
		<category><![CDATA[Wii nunchuck]]></category>

		<guid isPermaLink="false">http://dangerousprototypes.com/?p=508</guid>
		<description><![CDATA[
See the latest version in the documentation wiki.
Scorpia shared his experience interfacing a Wii Nunchuck with the Bus Pirate I2C library. He used Seeed Studio&#8217;s breakout board that brings all the Nunchuck signals to an easy-to-tap header. Here&#8217;s some alternatives to the breakout board.



Bus Pirate
Wii Nunchuck breakout


MOSI/SDA
D (SDA)


CLOCK/SCL
C (SCL)


+3.3volts
+


GND
- (GND)



Connect the Bus Pirate to the [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-523" title="wii-overview.ii" src="http://dangerousprototypes.com.php5-11.dfw1-1.websitetestlink.com/wp-content/media/2009/08/wii-overview-ii.jpg" alt="wii-overview.ii" width="450" height="323" /></p>
<p><em>See the <a href="http://dangerousprototypes.com/docs/Wii_Nunchuck_quick_guide">latest version</a> in the documentation wiki.</em></p>
<p>Scorpia <a href="http://whereisian.com/forum/index.php?topic=59.0">shared his experience</a> interfacing a Wii Nunchuck with the <a href="http://www.buspirate.com">Bus Pirate</a> I2C library. He used <a href="http://www.seeedstudio.com/depot/wiichuck-a-wiinunchuck-break-out-board-p-379.html">Seeed Studio&#8217;s breakout board</a> that brings all the Nunchuck signals to an easy-to-tap header. Here&#8217;s some <a href="http://forums.nxtasy.org/index.php?showtopic=3075&amp;st=0&amp;p=23504&amp;#entry23504">alternatives to the breakout board</a>.</p>
<table border="0">
<tbody>
<tr>
<td><strong>Bus Pirate</strong></td>
<td><strong>Wii Nunchuck breakout</strong></td>
</tr>
<tr>
<td>MOSI/SDA</td>
<td>D (SDA)</td>
</tr>
<tr>
<td>CLOCK/SCL</td>
<td>C (SCL)</td>
</tr>
<tr>
<td>+3.3volts</td>
<td>+</td>
</tr>
<tr>
<td>GND</td>
<td>- (GND)</td>
</tr>
</tbody>
</table>
<p>Connect the Bus Pirate to the Wii Nunchuck breakout board as shown in the table. The nunchuck is powered from the Bus Pirate&#8217;s on-board 3.3volt regulator. The nunchuck has very small value internal pull-up resistors on the I2C bus pins, so the Bus Pirate <a href="http://dangerousprototypes.com/2009/07/27/bus-pirate-practical-guide-to-pull-up-resistors/">on-board pull-up resistors</a> aren&#8217;t needed.</p>
<p>Open the mode menu (m) in the Bus Pirate terminal and select the software I2C library (4). Enable the Bus Pirate&#8217;s power supplies (big &#8216;W&#8217;).</p>
<p>I2C&gt;[0xa4 0x40 0x00]<span style="text-decoration: underline;"><strong>&lt;&lt;&lt;Wii Nunchuck initialize</strong></span><br />
I2C START CONDITION<br />
WRITE: 0xA4 GOT ACK: YES<span style="text-decoration: underline;"><strong>&lt;&lt;&lt;write address</strong></span><br />
WRITE: 0&#215;40 GOT ACK: YES<span style="text-decoration: underline;"><strong>&lt;&lt;&lt;write location (?)</strong></span><br />
WRITE: 0&#215;00 GOT ACK: YES<span style="text-decoration: underline;"><strong>&lt;&lt;&lt;write 0 to location 0&#215;40 (?)</strong></span><br />
I2C STOP CONDITION<br />
I2C&gt;</p>
<p>Initialize the nunchuck, this only has to be done once. See also <a href="http://www.windmeadow.com/node/42">this example Arduino code</a>.</p>
<p>I2C&gt;[0xa4 0x00]<strong><span style="text-decoration: underline;">&lt;&lt;&lt;setup the read pointer</span></strong><br />
I2C START CONDITION<br />
WRITE: 0xA4 GOT ACK: YES<span style="text-decoration: underline;"><strong>&lt;&lt;&lt;write address</strong></span><br />
WRITE: 0&#215;00 GOT ACK: YES<span style="text-decoration: underline;"><strong>&lt;&lt;&lt;pointer to 0</strong></span><br />
I2C STOP CONDITION<br />
I2C&gt;[0xa5 r:6]<span style="text-decoration: underline;"><strong>&lt;&lt;&lt;read nunchuck measurements</strong></span><br />
I2C START CONDITION<br />
WRITE: 0xA5 GOT ACK: YES<span style="text-decoration: underline;"><strong>&lt;&lt;&lt;read address</strong></span><br />
BULK READ 0&#215;06 BYTES:<span style="text-decoration: underline;"><strong>&lt;&lt;read back 6 bytes</strong></span><br />
0&#215;78 ACK 0&#215;7A ACK 0&#215;2F ACK 0&#215;7D ACK 0&#215;6E ACK 0&#215;17 NACK<br />
I2C STOP CONDITION<br />
I2C&gt;</p>
<p>Reading data from the nunchuck takes two steps. First, set the read pointer. Next, read six  values to get the measurements, <a href="http://michael.lesauvage.name/cod4-nunchuk-leaner/">decoding guide here</a>.<br />
<span id="more-508"></span></p>
<p><img class="alignnone size-full wp-image-521" title="wii-connections" src="http://dangerousprototypes.com.php5-11.dfw1-1.websitetestlink.com/wp-content/media/2009/08/wii-connections.jpg" alt="wii-connections" width="450" height="285" /></p>
<p>Connection to the Wii breakout board. Thanks <a href="http://whereisian.com/forum/index.php?topic=59.msg301#msg301">Scorpia</a>!</p>
<p><img class="alignnone size-full wp-image-509" title="wii-nunchuck" src="http://dangerousprototypes.com.php5-11.dfw1-1.websitetestlink.com/wp-content/media/2009/08/wii-nunchuck.jpg" alt="wii-nunchuck" width="450" height="334" /></p>
<p>Wii Nunchuck image: <a rel="cc:attributionURL" href="http://www.flickr.com/photos/ravanderende/">http://www.flickr.com/photos/ravanderende/</a> / <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.0/">CC BY-NC-SA 2.0</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dangerousprototypes.com/2009/08/19/bus-pirate-wii-nunchuck-quick-guide/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
