<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.3" -->
<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/"
	>

<channel>
	<title>daniel shiffman</title>
	<link>http://www.shiffman.net</link>
	<description></description>
	<pubDate>Tue, 01 Apr 2008 18:51:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.3</generator>
	<language>en</language>
			<item>
		<title>Processing Sudden Motion Sensor Library</title>
		<link>http://www.shiffman.net/p5/sms/</link>
		<comments>http://www.shiffman.net/p5/sms/#comments</comments>
		<pubDate>Sat, 28 Oct 2006 19:26:39 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
		
	<category>General</category>
		<guid isPermaLink="false">http://www.shiffman.net/p5/processing-sudden-motion-sensor-library/</guid>
		<description><![CDATA[
Thanks to the open source Unimotion library by Lincoln Ramsay, I have developed a java native interface that allows access to the Apple Sudden Motion Sensor available in powerbooks (and macbooks) since 2005.
Download the library sms.zip.  Extract it to &#8220;. . ./Applications/Processing 0118/libraries&#8221; and you will have the following files:
sms.jar &#8212; contains the Unimotion [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.shiffman.net/p5/axes.jpg" alt="SMS Axes" class="right"/></p>
<p>Thanks to the open source <a href="http://members.optusnet.com.au/lbramsay/programs/unimotion.html">Unimotion</a> library by <a href="http://members.optusnet.com.au/a1291762/">Lincoln Ramsay</a>, I have developed a java native interface that allows access to the <a href="http://docs.info.apple.com/article.html?artnum=300781">Apple Sudden Motion Sensor</a> available in powerbooks (and macbooks) since 2005.</p>
<p>Download the library <a href="http://www.shiffman.net/p5/sms.zip">sms.zip</a>.  Extract it to &#8220;. . ./Applications/Processing 0118/libraries&#8221; and you will have the following files:</p>
<li class="arrow">sms.jar &#8212; contains the Unimotion class</li>
<li class="arrow">libUnimotionLib.jnilib &#8212; The java native interface to Unimotion</li>
<p>Source code for unimotion.c and Unimotion.java is contained in the src directory.</p>
<p>Available functions:</p>
<pre>
// Return x, y, and z values as array
public static int[] getSMSArray();

// Return just the X
public static int getSMSX();

// Return just the Y
public static int getSMSY();

// Return just the Z
public static int getSMSZ();
</pre>
<p>Example code:</p>
<pre>
import sms.*;

void setup() {
  size(200,200);
}

void draw() {
  int[] vals = Unimotion.getSMSArray();
  println(vals[0] + " " + vals[1] + " " + vals[2]);
}
</pre>
<p><b>History of Motion</b></p>
<li class="arrow">Written by Christian Klein</li>
<li class="arrow">JNI Implementation of motion by Dave Chatting</li>
<li class="arrow">Modified for iBook compatibility by Pall Thayer</li>
<li class="arrow">Modified for Hi Res Powerbook compatibility by Pall Thayer</li>
<li class="arrow">Modified for MacBook Pro compatibility by Randy Green</li>
<li class="arrow">Disparate forks unified into UniMotion by Lincoln Ramsay</li>
<li class="arrow">Made into a Java Native Interface by Daniel Shiffman</li>
]]></content:encoded>
			<wfw:commentRSS>http://www.shiffman.net/p5/sms/feed/</wfw:commentRSS>
		</item>
	</channel>
</rss>
