<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: webOS Development: AccelBall &#8211; A Practical Accelerometer Demo</title>
	<atom:link href="http://randallagordon.com/blog/2009/08/10/palm-pre-development-accellball-a-practical-accelerometer-demo/feed/" rel="self" type="application/rss+xml" />
	<link>http://randallagordon.com/blog/2009/08/10/palm-pre-development-accellball-a-practical-accelerometer-demo/</link>
	<description>Home of the Ranbot 3000</description>
	<lastBuildDate>Tue, 01 Feb 2011 16:08:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: randallagordon</title>
		<link>http://randallagordon.com/blog/2009/08/10/palm-pre-development-accellball-a-practical-accelerometer-demo/comment-page-1/#comment-214</link>
		<dc:creator>randallagordon</dc:creator>
		<pubDate>Thu, 22 Oct 2009 15:53:38 +0000</pubDate>
		<guid isPermaLink="false">http://randallagordon.com/blog/?p=191#comment-214</guid>
		<description>Welcome, I&#039;m glad it was helpful!

It would depend on what you&#039;re doing, really. In this case, yes, because I&#039;m not using the accelerometer data directly. It is simply used to adjust the &quot;drift&quot; variables which are what set the speed of the ball. Think in terms of, &quot;last I knew, the phone was tilted &lt;em&gt;this&lt;/em&gt; way, so I&#039;m going to base my math off that to determine where the ball should move &lt;em&gt;now&lt;/em&gt;.&quot;

The animation occurs separately from the action of the accelerometer. With the code the way it is, if, for whatever reason, the accelerometer stopped giving the app data, the app would be stuck animating the ball with the last known acceleration. So you can update at whatever framerate you wish, it would simply require scaling the accelerometer data differently. But framerate and animation are another subject entirely! ;)

The trick would be working out the math to suit your needs. With a little more time on the code it wouldn&#039;t be too difficult to allow the ball to perfectly match the Newtonian physics we all know and love! But, often for games, that isn&#039;t desirable and may make the game difficult to play. For applications where you&#039;re tracking g-force, precision is key (and 4Hz is not enough).

On that end of things, there are ways to adjust the update frequency. With root permissions, simply set the value of &quot;/sys/class/input/input5/poll_interval&quot; to a higher value (specified in ms, as I recall). There was someone working on an extension to allow an app to set this explicitly, but it too requires root permissions to install, so this isn&#039;t something which can be relied upon outside the homebrew community. I&#039;ve got my fingers crossed that Palm allows apps to set a higher refresh down the line...at which point, I&#039;ll likely write more on the subject.

Start going to town fiddling with the numbers and you&#039;ll get a good idea of what&#039;s going on. Adjust the scaling, the framerate, etc. and see what happens! That will cement the ideas far better than I can explain with words. :)</description>
		<content:encoded><![CDATA[<p>Welcome, I&#8217;m glad it was helpful!</p>
<p>It would depend on what you&#8217;re doing, really. In this case, yes, because I&#8217;m not using the accelerometer data directly. It is simply used to adjust the &#8220;drift&#8221; variables which are what set the speed of the ball. Think in terms of, &#8220;last I knew, the phone was tilted <em>this</em> way, so I&#8217;m going to base my math off that to determine where the ball should move <em>now</em>.&#8221;</p>
<p>The animation occurs separately from the action of the accelerometer. With the code the way it is, if, for whatever reason, the accelerometer stopped giving the app data, the app would be stuck animating the ball with the last known acceleration. So you can update at whatever framerate you wish, it would simply require scaling the accelerometer data differently. But framerate and animation are another subject entirely! <img src='http://randallagordon.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>The trick would be working out the math to suit your needs. With a little more time on the code it wouldn&#8217;t be too difficult to allow the ball to perfectly match the Newtonian physics we all know and love! But, often for games, that isn&#8217;t desirable and may make the game difficult to play. For applications where you&#8217;re tracking g-force, precision is key (and 4Hz is not enough).</p>
<p>On that end of things, there are ways to adjust the update frequency. With root permissions, simply set the value of &#8220;/sys/class/input/input5/poll_interval&#8221; to a higher value (specified in ms, as I recall). There was someone working on an extension to allow an app to set this explicitly, but it too requires root permissions to install, so this isn&#8217;t something which can be relied upon outside the homebrew community. I&#8217;ve got my fingers crossed that Palm allows apps to set a higher refresh down the line&#8230;at which point, I&#8217;ll likely write more on the subject.</p>
<p>Start going to town fiddling with the numbers and you&#8217;ll get a good idea of what&#8217;s going on. Adjust the scaling, the framerate, etc. and see what happens! That will cement the ideas far better than I can explain with words. <img src='http://randallagordon.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hertzi</title>
		<link>http://randallagordon.com/blog/2009/08/10/palm-pre-development-accellball-a-practical-accelerometer-demo/comment-page-1/#comment-213</link>
		<dc:creator>hertzi</dc:creator>
		<pubDate>Thu, 22 Oct 2009 08:13:37 +0000</pubDate>
		<guid isPermaLink="false">http://randallagordon.com/blog/?p=191#comment-213</guid>
		<description>Hi, 
thanks for that post - found it on twitter. After taking a quick look into your code I have a question. Since the accelerometer only works with 4 Hz (or did that change meanwhile?)  does it make any sense to run the animation function 30 times per second?</description>
		<content:encoded><![CDATA[<p>Hi,<br />
thanks for that post &#8211; found it on twitter. After taking a quick look into your code I have a question. Since the accelerometer only works with 4 Hz (or did that change meanwhile?)  does it make any sense to run the animation function 30 times per second?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
