0

How does one detect the amount of time the device has detected motion on the accelerometer?

If I wanted to detect continuous motion detection on the device such as 10 seconds of motion. How is this done? When I use the accelerometer delegate method, it keeps being called and is difficult to handle the time calculation.

user773578
  • 1,161
  • 2
  • 13
  • 24
  • The accelerometer cannot detect motion anyway. Only acceleration (= change of motion). – Ole Begemann Sep 28 '11 at 10:39
  • 10 seconds of continuous accelerometer data. I would like to try an trigger certain actions once e.g. the device has been moved around/shaken etc for n seconds – user773578 Sep 28 '11 at 11:23

1 Answers1

0

As commented, accelerometer delivers acceleration values and not speed - so you will have to integrate over incoming values. Bu bevare of: - earth gravity is always there - there is a lot of noise (accelerometer chips built in phones are really cheap, crappy and sell for 10$ a bucket)

Konstantin Pribluda
  • 12,329
  • 1
  • 30
  • 35