Author Topic: How to find how fast the iPhone is moving?  (Read 4303 times)

Posly

  • Guest
How to find how fast the iPhone is moving?
« on: November 23, 2012, 03:09:13 pm »
I'm making an app to see how fast your punches are. Basically the user would hold their iPhone, throw a punch, and the iPhone's accelerometer would find the speed of that punch. But I'm having trouble accessing the iPhones accelerometer, on the homepage of DragonFireSDK it says that it supports the accelerometer, but I couldn't find and functions that find the speed using an accelerometer in the docs. Am I mistaking the accelerometer, does the accelerometer find translation in the x, y, and z axis? So basically is there any way to see how fast the iPhones moving. I tried using LocationGetSpeed but it was too inaccurate. Thanks!

Nico91

  • Guest
Re: How to find how fast the iPhone is moving?
« Reply #1 on: November 24, 2012, 02:25:21 am »
 I also had tried to do this but you can not. the accelerometer measures the inclination of the iPhone not the speed of movement. also the movement of a punch is 50 cm long maximum so i do not think that other tools such as GPS and compass work fine.

ciuffolo

  • Guest
Re: How to find how fast the iPhone is moving?
« Reply #2 on: November 27, 2012, 03:38:45 pm »
don't know if this is what are you looking for, but...
i tried it for one of my first application:
Put it in OnTimer
catch the x coordinate;x=x coordinate(i will use only x)
x=TiltGetX
intervall of time.you will move the iphone
x1=TiltGetX
if (x==x1)
iphone didn't move
if (x!=x1)
Iphone moved
int intervall=x1-x(intervall of time,"velocity")
if (intervall>300(what do you need))
print"you move the iphone too fast";

my english and my code aren't very correct but i hpoe you understood...it was only an idea

graham

  • Guest
Re: How to find how fast the iPhone is moving?
« Reply #3 on: November 28, 2012, 12:25:11 pm »
like nico said: that measures tilt, not translation.

ciuffolo

  • Guest
Re: How to find how fast the iPhone is moving?
« Reply #4 on: November 29, 2012, 03:22:58 pm »
oh ... I think I misunderstood ... in any way for the punch I do not think you can do nothing for now
sorry,but i was hurry

Posly

  • Guest
Re: How to find how fast the iPhone is moving?
« Reply #5 on: November 29, 2012, 03:37:28 pm »
Hm yeah I didn't know the iPhone didn't have an "good" accelerometer built in. It looks like its pretty much impossible to measure speed accurately over short distances. Thanks for the replies though!

graham

  • Guest
Re: How to find how fast the iPhone is moving?
« Reply #6 on: November 30, 2012, 01:12:00 pm »
@posly: i think it's more a question of the dragonfire guys not having implemented the functionality in their SDK.

ciuffolo

  • Guest
Re: How to find how fast the iPhone is moving?
« Reply #7 on: December 01, 2012, 12:41:28 am »
You can report it.
It will maybe a good function.