Question

I am wanting to have my device sense small vibrations, such as a small shake, or someone breathing. I am assuming that this is possible because the app store has a number of "Sleep Pattern Monitor" apps, and they have good reviews.

Does anyone know a way, using the accelerometer or gyroscope (or something else?) to sense these small movements or vibrations? If so, is there sample code?

Was it helpful?

Solution

You can look at

http://developer.apple.com/library/ios/#documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/MotionEvents/MotionEvents.html

Which has some examples on what to do.

While building my app I needed device orientation so I subscribed to beginGeneratingDeviceOrientationNotifications which was a pain because it would actually trigger an event on every slight movement that occurred while the iPad was on my desk. From me just slightly moving the iPad to me typing on my keyboard while it was on my desk. I would look into both of those.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top