开发者

using accelerometer to determine if phone is at rest

开发者 https://www.devze.com 2023-02-26 05:18 出处:网络
I\'m building an app using the Windows Phone 7 SDK and I\'ve 开发者_如何学运维got a thread that is constantly returning X, Y, and Z accelerometer data.I need to determine at any given time whether the

I'm building an app using the Windows Phone 7 SDK and I've 开发者_如何学运维got a thread that is constantly returning X, Y, and Z accelerometer data. I need to determine at any given time whether the phone is moving or not. Can someone help me step through the logic/math needed for this?


Use a high-pass filter. Chose an alpha arbitrarily (0.3 seems as a good initial guess), and if y[i] exceeds a threshold determined by your experiments then the phone is moving, otherwise it is not. Note that you only need to store the last y[i] and the last measurement. Good luck!

0

精彩评论

暂无评论...
验证码 换一张
取 消