i used this method to handle shake event on my app , but i have huge problem that drive me crazy !
i use this method :
http://www.iphonedevsdk.com/forum/iphone-sdk-development/55087-iphone-shake-detection-problem.html#post230283
but the problem is app detect multiple times shake event !
2010-08-10 14:06:43.700 APP[406:207] SHAKED
2010-08-10 14:06:44.340 APP[406:207] SHAKED
2010-08-10 14:06:44.692 APP[406:207] SHAKED
2010-08-10 14:06:44.868 APP[406:207] SHAKED
2010-08-10 14:06:45.044 APP[406:207] SHAKED
2010-08-10 14:06:45.172 APP[406:207] SHAKED
2010-08-10 14:06:45.332 APP[406:207] SHAKED
2010-08-10 14:06:45.492 APP[406:207] SHAKED
2010-08-10 14:06:45.644 APP[406:207] SHAKED
how cab i handle it ?
You have to debounce the data before it is usable. The principle is quite simple, once you read a
SHAKEjust ignore all values for the next second or so.You might want to consider making the sensitivity (delay) configurable.
Example code: