Moving Milan’s ears, to activate a PHP script

As I said in my previous (first) post, Milan is a Nabaztag wifi bunny made of plastic — something like the Ambient Devices Orb. Unlike the Orb however — and more like a bunny rabbit — he has ears that move.

They have little motors, allowing Milan to move his ears when a new message arrives from the nabaztag.com server. More interestingly though, they have sensors which can tell if I have moved the ears by hand, how far I’ve moved them, and in which direction. I could move the right ear back as far is it will go, and the left ear as far forward as it goes, for example. Milan will then send a quick message to the nabaztag.com server saying “my ears have moved. The left one is at position x, and the right one is at position y.” With the API, I can easily get a hold of that information and use it to run some code on a server if I want to.

Here’s an example PHP script which will change the background color of a webpage depending on the position of the rabbit’s ears:

";
//print_r($ears);

// Latest ear position reported by API
$posright = $ears[0][0];
$posleft = $ears[0][1];

?>

">
<h1>Current Ear Positions</h1>
<h2>Left Ear</h2>
<h2>Right Ear</h2>
<blockquote>

Try this: Move the ears and then reload this page.</blockquote>
</pre>
</div>
<p class="meta">March 5, 2006.  <a href="http://gettingtoknowmilan.wordpress.com/category/uncategorized/" title="View all posts in Uncategorized" rel="category tag">Uncategorized</a>. </p>

</div>


   
		<!-- If comments are open, but there are no comments. -->
		<h3>No Comments Yet</h3>
		<p>Be the first to comment!</p>
	

<div id="respond">
	<h2>Leave a Reply</h2>
	<div id="cancel-comment-reply"><small><a rel="nofollow" id="cancel-comment-reply-link" href="/2006/03/05/moving-milans-ears-to-activate-a-php-script/#respond" style="display:none;">Click here to cancel reply.</a></small></div>


<form id="reply" method="post" action="http://gettingtoknowmilan.wordpress.com/wp-comments-post.php">
	<div id="hidden">
		<input type='hidden' name='comment_post_ID' value='3' id='comment_post_ID' />
<input type='hidden' name='comment_parent' id='comment_parent' value='0' />
		<input type="hidden" name="redirect_to" value="/2006/03/05/moving-milans-ears-to-activate-a-php-script/" />
	</div>

	<div id="c_personal">


	<p><label for="author">Name</label><input type="text" name="author" id="author" value="" size="22" tabindex="1" /></p>

	<p><label for="email">Email</label><input type="text" name="email" id="email" value="" size="22" tabindex="2" /></p>

	<p><label for="url">Website</label><input type="text" name="url" id="url" value="" size="22" tabindex="3" /></p>

	</div>

	<div id="c_comment">
	<p><label for="comment">Comment</label>
			<textarea name="comment" id="comment" rows="5" cols="34"></textarea></p>

			<input id="submit" class="button" type="submit" value="Reply" />
	</div>

	</form>
</div>

			<p><a href="http://gettingtoknowmilan.wordpress.com/2006/03/05/moving-milans-ears-to-activate-a-php-script/trackback/" title="Trackback URI">Trackback URI</a></p>



	</div>
	<div id="sidebar">
		<h1>sidebar</h1>


<h2>Other Stuff</h2>
<ul>
<li class="page_item page-item-2"><a href="http://gettingtoknowmilan.wordpress.com/about/" title="About">About</a></li>
</ul>

<h2>Friends</h2>
<ul>
<li><a href="http://eoin.free.fr/blog/" title="Immortality">Eoin Dubsky’s blog</a> Immortality</li>
<li><a href="http://wordpress.com/">WordPress.com</a></li>
<li><a href="http://wordpress.org/">WordPress.org</a></li>
</ul>

<h2>Archives</h2>
<ul>
	<li><a href='http://gettingtoknowmilan.wordpress.com/2006/06/' title='June 2006'>June 2006</a></li>
	<li><a href='http://gettingtoknowmilan.wordpress.com/2006/03/' title='March 2006'>March 2006</a></li>
</ul>
<h2>Categories</h2>
<ul>
<li><a href="http://gettingtoknowmilan.wordpress.com"> </a></li>	<li class="cat-item cat-item-1"><a href="http://gettingtoknowmilan.wordpress.com/category/uncategorized/" title="View all posts filed under Uncategorized">Uncategorized</a>
</li>
</ul>


<p><a href="http://gettingtoknowmilan.wordpress.com/wp-login.php">Log in</a></p>

	</div>
	<div id="footer">
	<p><a href='http://wordpress.com/' rel='generator'>Blog at WordPress.com</a>.</p>
	</div>
</div>


<script type="text/javascript" src="http://wordpresscom.skimlinks.com/api/wordpress.js"></script>
<script type="text/javascript">
var skimlinks_pub_id = "725X1342";
var skimlinks_sitename = "gettingtoknowmilan.wordpress.com";
var skimlinks_domain = "go2.wordpress.com";
skimlinks();
</script><script type="text/javascript" src="//secure.quantserve.com/quant.js"></script>
<script type="text/javascript">_qoptions = { labels:"adt.0,language.en" };_qacct="p-18-mFEk4J448M";quantserve();</script>
<noscript><p><img src="//secure.quantserve.com/pixel/p-18-mFEk4J448M.gif?labels=adt.0%2Clanguage.en" style="display: none" height="1" width="1" alt="" /></p></noscript>
<script src="http://s.stats.wordpress.com/w.js?19" type="text/javascript"></script>
<script type="text/javascript">
st_go({'blog':'120932','v':'wpcom','user_id':'0','post':'3','subd':'gettingtoknowmilan'});
ex_go({'crypt':'RDZ8LFkxbXFKfnxTcjN3eDdlYixRLWQ4amlhcE1tN2Ruby8wUj1ZTk9kQ3xQUjdKcj9PaFJaPXhjTDkvZjBRNHJGczhFZVJ5azB8LXh2SnlmaXFrY3BpM3I0PXBSdXxJTE5FYStxdGV1cWJVMzE1WUR0QnhDNmxQdXBCRTRqJjBnSCY3XUtySjJHLC1NbH5jJldDfGZpZFYtemJ+YS4uS0E1LltoJlF3K3N0dVl5bHh6K2VjdU94dVJlZ3o='});
addLoadEvent(function(){linktracker_init('120932',3);});
	</script>

</body>
</html>