iPhone Accelerometer Demos?

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

  1. macrumors bot

    MacRumors

    Joined:
    Apr 12, 2001
    #1
    [​IMG]

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

    Video

    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. macrumors member

    Joined:
    Aug 27, 2007
  3. macrumors 68040

    Telp

    Joined:
    Feb 6, 2007
    #3
    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. macrumors 6502a

    mustang_dvs

    Joined:
    Feb 9, 2003
    Location:
    Durham, NC
    #4
    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. macrumors newbie

    Joined:
    Aug 27, 2007
    #5
    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. macrumors member

    deasine

    Joined:
    Mar 19, 2007
    #6
    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. macrumors 65816

    chr1s60

    Joined:
    Jul 24, 2007
    Location:
    California
    #7
    Looks fake to me. I don't think the accelerometer is as sensitive as the videos are showing.
     
  8. macrumors 68040

    Telp

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

    shrimpdesign

    Joined:
    Dec 9, 2005
    #9
    Here's his blog post about it:
    http://blog.medallia.com/2007/08/fun_with_the_iphone_accelerome.html

    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. macrumors 601

    Chaszmyr

    Joined:
    Aug 9, 2002
    #10
    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. macrumors 6502a

    shrimpdesign

    Joined:
    Dec 9, 2005
    #11
    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. macrumors 6502a

    gceo

    Joined:
    Jul 13, 2007
    Location:
    San Diego, CA
    #12
    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. macrumors newbie

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

    Code:
    - (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. macrumors 68040

    mduser63

    Joined:
    Nov 9, 2004
    Location:
    Salt Lake City, UT
    #14
    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. macrumors 68030

    Snowy_River

    Joined:
    Jul 17, 2002
    Location:
    Corvallis, OR
    #15
    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. macrumors regular

    Joined:
    Jun 5, 2004
    Location:
    Tallahassee, FL
    #16
    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. macrumors 6502

    Joined:
    Mar 3, 2005
    Location:
    Virginia, U.S.A.
    #17
    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. macrumors regular

    Joined:
    Feb 1, 2006
    Location:
    Los Angeles
    #18
    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. macrumors 68000

    swordfish5736

    Joined:
    Jun 29, 2007
    Location:
    Cesspool
    #19
    works fine for me. I'm running 3.0.3 on a G4 powerbook
     
  20. macrumors 68040

    Telp

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

    Joined:
    Dec 11, 2006
    #21
    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. macrumors newbie

    Joined:
    Jul 1, 2007
    #22
    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. macrumors 6502a

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

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

    Joined:
    Jul 1, 2007
    #25
    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