views:

43

answers:

1

How can you use the accelerometer to detect if the phone has come to a halt.

In my case iw want to use it for, i'd like to detect whether its changed direction on the same axis ( a u-turn) which would involve the device stopping.

Any ideas appreciated.

Thanks,

Sam.

+1  A: 

You can't - there is no way of knowing velocity knowing only the acceleration (no initial velocity), and even with an initial velocity, errors in the accelerometer would quickly add up to give inaccurate results.

The only real way of doing it is using the GPS.

BlueRaja - Danny Pflughoeft
See my answer to Sam's last question on this topic; you can, if you're prepared to accept an estimate and do a bunch of tweaking.
Andrew McGregor
the gps is not accurate enough for this tho is it?
Sam Jarman
Sure it is. [15 char limit is stupid]
BlueRaja - Danny Pflughoeft
It couldnt be. The gps cant detect turning within a few inches
Sam Jarman
Exactly... it's not going to detect a turn-around in the sense Sam is asking about because it has a position error of a few meters. GPS coordinates wander around a circle the size of the error at about walking pace when you're standing still.
Andrew McGregor