32 comments

[ 28.1 ms ] story [ 1416 ms ] thread
And which devices that support Firefox or Chrome actually have accelerometers? It doesn't work on my Froyo phone...
It doesn't only support Firefox and chrome, but my N900 has both and it works fine (though slowly).
the nexus 1/s, probably.
Default Nexus 1 install has a Mobile Webkit browser, which doesn't even get the interactive version.

It works - somewhat - on an iPad - but there's a problem in that tilting the iPad makes the screen rotate and locking the screen seems to disable the tilt events.

Best experience is on a MacBook with Chrome, IMHO.

Ditto default Nexus S. Dang.
Incredible that the clever google logo doesn't work on the google phone...
ThinkPads, Mac Laptops
Doesn't work on my new Thinkpad T510, running Ubuntu and Chromium 9.0.

I know it has an accelerometer (I've seen the bundled Windows software use it), but I don't know where the API to access that data is.

Works on my iPhone with Safari and my MacBook with Chrome, but not on my MacBook with Safari. Go figure.
FYI, the accelerometer works on a MacBook Pro with Chrome or Firefox as well. I remember when Kris showed me the demo on his Mac, I was like "Wow, you can do that on a normal laptop?"
All kinds of laptops have had accelerometers since the early 2000s or so. (IBM ran commercials for their ThinkPads with “airbag” all the time. Yep, this was already built into laptops when IBM still sold ThinkPads.) They stop the hard drive when accelerations get too extreme.
Yet having the accelerometer made usable by software is actually nice. It was (and still can be, sometimes in HD themselves) often a hardwired feature. Also, there's quite a gap in sensibility between detecting a drop and registering subtle variations of the acceleration vector.
I thought they stopped the drive when the acceleration is zero (freefall). If the acceleration is high, it's probably too late.
Zero acceleration only happens after an object has been falling for a long time (more then a few seconds) and the friction is in balance with gravity. Zero acceleration also happens when the laptop is just sitting on a table. Probably wouldn't be a good measure to stop the drive.

Initially, an object falling will accelerate with g=9.81m/s^2, after it reaches the ground it will de-accelerate to a speed of 0m/s in a couple of ms. You are confusing weightlessness/zero-g with no acceleration.

I'm talking about the acceleration that the sensor is measuring. If you are holding it still, it measures 1g toward the ground.

If the drive is falling, certainly it is accelerating toward the ground but the sensor measures zero acceleration. This is the relative frame of reference.

The accelerometer interaction hooks into javascript via browser events.

Here's the basic usage for chrome: (for firefox the event is MozOrientation, and values are radians rather than degrees)

  window.addEventListener('deviceorientation', function(evt) {
    var x = evt.gamma, y = evt.beta;
  }, false);
I navigated through the entire doodle just to see if there was something encoded in it as well, like in the cr-48 ad.
I didn't know they'd done it. I opened Firefox and grabbed my Macbook to head for the couch and was most surprised by the awesome.
It would be interesting to log this data, and try to figure out how many users are leaning back, in a car, etc. I wonder what kind of patterns you'd see.
Doesn't work on my 2010 Macbook Air. I was a little confused until it dawned on me that due to the SSD, Apple had no reason to build in an accelerometer.
Doesn't work on Android? Sometimes Google confuses me.