PDA

View Full Version : iPhone Accelerometer Demos?




MacRumors
Aug 27, 2007, 11:11 PM
http://www.macrumors.com/images/macrumorsthreadlogo.gif (http://www.macrumors.com)

Gizmodo reports (http://gizmodo.com/gadgets/clips/fun-with-the-iphones-accelerometer-293969.php) on one blog (http://blog.medallia.com/) who claims to have been able to access the iPhone accelerometers to produce some interesting effects.

Video (http://www.youtube.com/watch?v=Wtcys_XFnRA)

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 (http://www.macrumors.com/iphone/2007/08/28/iphone-accelerometer-demos/)



nismo
Aug 27, 2007, 11:16 PM
pretty cool I hope its real

Telp
Aug 27, 2007, 11:24 PM
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?

mustang_dvs
Aug 27, 2007, 11:30 PM
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.)

mrkitty
Aug 27, 2007, 11:54 PM
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.

deasine
Aug 27, 2007, 11:54 PM
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...

chr1s60
Aug 28, 2007, 12:04 AM
Looks fake to me. I don't think the accelerometer is as sensitive as the videos are showing.

Telp
Aug 28, 2007, 12:13 AM
I havent seen the video yet (stupid safari beta)

shrimpdesign
Aug 28, 2007, 12:21 AM
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.

Chaszmyr
Aug 28, 2007, 12:23 AM
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.

shrimpdesign
Aug 28, 2007, 12:29 AM
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.

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.

gceo
Aug 28, 2007, 12:36 AM
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.

grudgnor
Aug 28, 2007, 12:40 AM
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??

mduser63
Aug 28, 2007, 12:40 AM
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.

Snowy_River
Aug 28, 2007, 02:26 AM
I havent seen the video yet (stupid safari beta)

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.

whenpaulsparks
Aug 28, 2007, 06:31 AM
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.

MacHarne
Aug 28, 2007, 06:48 AM
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.

sartinsauce
Aug 28, 2007, 08:47 AM
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.

swordfish5736
Aug 28, 2007, 10:08 AM
I havent seen the video yet (stupid safari beta)

works fine for me. I'm running 3.0.3 on a G4 powerbook

Telp
Aug 28, 2007, 10:10 AM
Really? Half the time my flash doesnt work, and i have to restart safari countless times till it works.

CJD2112
Aug 28, 2007, 12:06 PM
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:

grudgnor
Aug 28, 2007, 12:21 PM
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.

CJD2112
Aug 28, 2007, 12:42 PM
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.

You might want to change the name of the app. Balls lol ;). Ok, ok, I have a dirty mind...

pyrex
Aug 28, 2007, 01:21 PM
you should put that app on installer.app somehow for an easier install

grudgnor
Aug 28, 2007, 02:15 PM
You might want to change the name of the app. Balls lol ;). Ok, ok, I have a dirty mind...

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

CJD2112
Aug 28, 2007, 02:38 PM
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

Hey, it's your first Cocoa app, be proud! :) I haven't even written one, but I'll check yours out.

shrimpdesign
Aug 28, 2007, 03:05 PM
Well, he posted the source code:

http://blog.medallia.com/2007/08/iphone_accelerometer_source_co.html

He says:
yes, it is possibly to access the accelerometer directly through UIKit without this hack -- however, you'll be locked to the default sample rate, which is too slow for some of the fun stuff

The General
Aug 28, 2007, 03:38 PM
I wish he'd post the Steve Jobs bobblehead app... along with the others. :(

badtzmaru
Aug 28, 2007, 04:10 PM
people who say things are fake usually lack the skills to pull something off.

yzp
Aug 28, 2007, 04:14 PM
pretty cool I hope its real

if it's real, it is some realistics!!

verry hawt!

yzp
Aug 28, 2007, 04:16 PM
pretty cool I hope its real

if it's real, it is some realistics!!

verry hawt!

MacQuest
Aug 28, 2007, 07:42 PM
Also, why does everyone always assume this stuff is fake??

Because they have no idea how to do it themselves, and it's just easier to lump things like this in with the fake product shots and rumors.

nagromme
Aug 28, 2007, 08:10 PM
Too cool!

Thanks, grudgnor.

The General
Aug 28, 2007, 08:32 PM
Balls.app doesn't work for me. It shows the ball, but nothing happens ... :confused:

The only way to exit is to restart my iPhone.

QuarterSwede
Aug 28, 2007, 11:13 PM
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...
Actually, accelerometers aren't all that amazing. If you research it you'll find it works very simply, that's part of the beauty I suppose. And writing an app to take advantage of the accelerometer data isn't hard (from what I understand).

grudgnor
Aug 29, 2007, 02:55 PM
Balls.app doesn't work for me. It shows the ball, but nothing happens ... :confused:

The only way to exit is to restart my iPhone.

Sorry to hear that. I'm really not sure what could be causing the problem. Are you building from source?

CJD2112
Aug 29, 2007, 03:22 PM
Because they have no idea how to do it themselves, and it's just easier to lump things like this in with the fake product shots and rumors.

No, cause more often than not it's someone making things up to get attention. Example, the dozens of fake 6G widescreen iPods that were floating around last year, or the numerous fake Apple products such as the "iHome" (remember the pictures floating around years ago before a major Apple event with fake "iHome" boxes?). People want attention, and 95% of the time they make things up to get it, just a sad fact of life. :(

Kingsly
Aug 29, 2007, 06:53 PM
I want that marble game!!!! IMO, that is the only thing missing from the current iPhones. :D

j00sh
Sep 2, 2007, 04:46 PM
balls.app doesnt work for me either
Shows an image of paper and pencils freezes at that. I used WinSCP and put the balls.app into the apps folder and chmod the acceleromterapp file.

SPUY767
Sep 10, 2007, 09:03 PM
I've been working on an accelerometer app that will time a car's 0-60 acceleration. At present, I'm only able to map Accleration in the y axis as a number taken every second. It has to be plotted in Excel to be meaningful. Eventually, I hope to have code that estimates when you have hit 60 mph based on the accelerometer numbers, and to output that number. If I can get there successfully, I can see myself Perhaps putting in a stopwatch graphic with multi colored hands to represent meaningful MPH/distance marks.

jamesarm97
Sep 13, 2007, 05:33 PM
I had mentioned a pretty cool idea thought on another thread before these demos came out. They said the chip could only detect x and y but I figured it had to be 3 axis because it is a common chip. I played with the demo called 'Sensors' from the Installer app and it is pretty sensitive and could clearly detect when the phone was face down / face up, rotated left or right or angled. It would be cool to tell when it is in the dock (vertical at slight tilt, maybe can be done with another api that shows it is docked), or when it is completely horizontal as in face down / up or not moving for awhile and if in one of those states, have a notification nag or something that will repeat missed sms or call notifications. Or even better, if not moved in awhile, then moved as in picked up, turn on and notify of missed calls / sms messages. I find myself setting the phone down at home and missing a lot of 'important' sms messages.

- James

prophet8511
Oct 25, 2007, 12:04 PM
Ive looked at a few websites but I cant seem to understand is this app out or is he just showing what can be done? If its out where cna i get it?

shurcooL
Aug 17, 2011, 04:19 PM
It's neat to see how different the iPhone landscape was only a few years ago.

I mean, something that seems so simple and we take for granted today, was totally cutting edge news back then.