Hey guys!
I'm developing an application which uses the accelerometer sensor, available on some S60 phones. I want to handle a shake, by using the RDAccelerometer.lib . So, i'm already using the accelerometer, I just need to get good values for a shake. The current values i'm using are very sensitive, any little shake on the phone, and it triggers the action. The code i'm currently using is:
I've already checked the MovingBall source code, but it didn't helped me on how to handle shakes, anyway.Code:void CMusicShakeAppView::HandleAccelerationL( TInt aX, TInt /*aY*/, TInt /*aZ*/ ) { iAccelX[iAIndex++]=aX; //Only on X if (iAIndex>1) { TInt Diff = iAccelX[0] - iAccelX[1]; if ( aX>30 ) { //Do something here ... } iAIndex=0; } }
If you could help me would be great
Thanks!!!
(Especial thanks to Paul Todd who gave me the hint of the S60 Public API in my last topic!)


Reply With Quote


