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.

Sam Jarman
  • 7,277
  • 15
  • 55
  • 100

1 Answers1

2

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.

Community
  • 1
  • 1
BlueRaja - Danny Pflughoeft
  • 84,206
  • 33
  • 197
  • 283
  • 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 Jan 17 '10 at 05:34
  • the gps is not accurate enough for this tho is it? – Sam Jarman Jan 17 '10 at 05:58
  • It couldnt be. The gps cant detect turning within a few inches – Sam Jarman Jan 17 '10 at 08:13
  • 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 Jan 17 '10 at 22:20