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]; ?> "> Current Ear Positions
Left Ear
Right Ear
Try this: Move the ears and then reload this page.
No Comments Yet
Be the first to comment!