문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top