iPhone Accelerometer Demos?

Discussion in 'iOS Blog Discussion' started by MacRumors, Aug 27, 2007.

  1. MacRumors macrumors bot


    Apr 12, 2001

    Gizmodo reports on one blog who claims to have been able to access the iPhone accelerometers to produce some interesting effects.


    No one can yet attest to the accuracy of these demos, as they do seem a bit more sensitive than the accelerometers appear to be on the iPhone.

    Article Link
  2. nismo macrumors member

    Aug 27, 2007
  3. Telp macrumors 68040


    Feb 6, 2007
    Although it doesnt look real, it wouldnt surprise me that someone has done this. People have done this with the sudden motion sensor in the macs, so why not?
  4. mustang_dvs macrumors 6502a


    Feb 9, 2003
    Durham, NC
    Methinks that these are simply videos that are playing on the iPhone and the "user" is moving to cues that make it look like he's causing the actions on-screen. (There's a "magician" who does exactly that, first with Palm Pilots, now with an iPhone.)
  5. mrkitty macrumors newbie

    Aug 27, 2007
    i say fake.

    one thing to actually hack that deep this early, quite another to have written three separate applications that take advantage of it already. somehow, i'd think we'd had heard after the first "proof of concept" app worked.
  6. deasine macrumors member


    Mar 19, 2007
    I don't think those are real...

    But I know the next generation (Java 8) Sony Ericsson Phones with the accelerometers can do the marble game for sure. Pretty amazing what technology can do now...
  7. chr1s60 macrumors 68000


    Jul 24, 2007
    Looks fake to me. I don't think the accelerometer is as sensitive as the videos are showing.
  8. Telp macrumors 68040


    Feb 6, 2007
    I havent seen the video yet (stupid safari beta)
  9. shrimpdesign macrumors 6502a


    Dec 9, 2005
    Here's his blog post about it:

    It's from the same guy who made the SmackBook hack (hit the side of your MacBook, and virtuedesktops switches desktops) so I think it's legit. He says that he tapped the raw accelerometer data.

    The accelerometer in the iPhone doesn't seem sensitive, but that's because Apple uses it for the display rotation, it probably detects massive changes in orientation, not little ones, so it won't change on accident.
  10. Chaszmyr macrumors 601


    Aug 9, 2002
    The iPhone accelerometer seems nowhere near that sensitive, I call fake. It is of course possible that Apple intentionally made the accelerometer less sensitive in their software so you don't accidently turn stuff when you make subtle movements.
  11. shrimpdesign macrumors 6502a


    Dec 9, 2005
    I think it's much more likely that Apple has a regular accelerometer, and only switches landscape/portrait when it detects a big change in orientation.
  12. gceo macrumors 6502a


    Jul 13, 2007
    San Diego, CA
    I'm kinda surprised at the number of people that think it's fake. Y'all are crazy. The dude's legit. Read the pdf on the sensor. Output sample rate up to 400 Hz... "not that sensitive" Huh? It's in the hardware.

    This is sweet. Fast forward a year... games, apps, bumping input, etc... It'll be tight.
  13. grudgnor macrumors newbie

    Jul 1, 2007
    Yes, the iPhone accelerometer data is that sensitive, and it's even easier to get access through UIApplication.h

    - (void)acceleratedInX:(float)fp8 Y:(float)fp12 Z:(float)fp16;
    Just override that method and you'll get instant float values that you can use, and it is very sensitive. I had a simple ball demo with velocity, acceleration and collision detection working over a week ago.

    Although, I'm not sure why the authors say that they had to do "a rather lengthy bout of reverse engineering" and talk about ARM assembly, the iPhone dev community has known about the easily accessed Cocoa API for a long time.

    Also, why does everyone always assume this stuff is fake??
  14. mduser63 macrumors 68040


    Nov 9, 2004
    Salt Lake City, UT
    There really aren't that many accelerometer chips available for Apple to use, and all the ones I've worked with (several) are very sensitive. Obviously right now, Apple only cares about ~90 degree changes in orientation, but there's no reason for them to throw away the raw data coming off the accelerometers, and it doesn't seem at all implausible that it's available to developers.
  15. Snowy_River macrumors 68030


    Jul 17, 2002
    Corvallis, OR
    Runs fine on mine. (v3.0.3, 1.67GHz G4)

    I thought about the idea of it being a queued video. (I did something like that with queued speech to make it seem like I was talking to my computer. Great practical joke on a friend of mine about 10 years ago! :D )

    However, if it is that, then the queues are exceptionally well done. At this point I'm more inclined to think that it's actually real.
  16. whenpaulsparks macrumors regular

    Jun 5, 2004
    Tallahassee, FL
    the accelerometer, if it is anything like the MacBooks, and it probably is, then yes it is that sensitive. apple probably made it seem less sensitive to prevent accidental screen rotations. do yourself a favor and get one of those apps where you can see the accelerometer data from your MacBook. sometimes just walking into the room can cause minor readings on the sensors.
  17. MacHarne macrumors 6502

    Mar 3, 2005
    Virginia, U.S.A.
    Accelerometer data can be used in a variety of ways. The rotation modes of the iPhone, for example, require that a certain voltage is reached and sustained for a period of time by the changing resistance inside of the accelerometer. A fast or slow rotation should both produce the same result - the voltages summing over time, in effect. Then, the iPhone does the rotation transition, similar to a Keynote transition, and all of sudden it's like you changed screen orientations.

    I say this YouTube demo is real. All you have to do is stream the accelerometer data live and relate the data to a graphical display transition, in this case rolling marbles or that one game thing. It's a relatively simple amount of code to write, even in, say, LabView or MATLAB. I think the harder hack is getting it to actually run inside of the iPhone.
  18. sartinsauce macrumors regular

    Feb 1, 2006
    Los Angeles
    Looks pretty real to me. Why wouldn't it be? I know the iPhone doesn't seem to respond quickly, but as someone else suggested, I suspect Apple has got the software weeding out the data it needs for 90 degree rotations.

    Besides, real or fake, it's a cool freakin' clip.
  19. swordfish5736 macrumors 68000


    Jun 29, 2007
    works fine for me. I'm running 3.0.3 on a G4 powerbook
  20. Telp macrumors 68040


    Feb 6, 2007
    Really? Half the time my flash doesnt work, and i have to restart safari countless times till it works.
  21. 3282872 macrumors 6502a

    Dec 11, 2006
    Fake. There is no way that it is that sensitive. Besides, if it were true why hasn't the source code been posted and why is the video clip so short? :cool:
  22. grudgnor macrumors newbie

    Jul 1, 2007
    Here's proof that this isn't fake

    Here's my code for a very very (very) basic accelerometer based application that I was working on a couple of weeks ago. It's my first Cocoa app ever, as well as my first jump into any kind of game programming. It's just a ball that accelerates when you tilt around your iPhone, and hopefully collides with the walls that are around it. Because of my inexperience with basic collision detection, sometimes the ball breaks through the barriers, but you can get the basic idea of what I was doing from this.

    As you can tell from the source, getting to the iPhone's accelerometer data is really easy, just overriding a method that is provided by Apple's UIApplication framework, which every iPhone application has access to. Although it's not documented on the internet very well at all, the good folks at iphone-dev/iphone-uikit channel provided me with help with getting to the accelerometer data (thanks kroo).

    I might post a video if people still don't believe that the accelerometer is really this sensitive for those who haven't started with 3rd party apps yet.

    I'd like to mention that the developer in the Youtube video definitely has some awesome programs, and I only wish I had the cocoa expertise to write them.

    Attached Files:

  23. 3282872 macrumors 6502a

    Dec 11, 2006
    You might want to change the name of the app. Balls lol ;). Ok, ok, I have a dirty mind...
  24. pyrex macrumors member

    Jan 11, 2003
    you should put that app on installer.app somehow for an easier install
  25. grudgnor macrumors newbie

    Jul 1, 2007
    Haha, yeah I thought about that, but with the frustration that's involved with writing my first cocoa app for a device that doesn't have formal 3rd party application support, I needed something stupid that would make me laugh.

    And seriously, this app is nothing great, I feel like it's not worth putting on Installer.app

Share This Page