trying to synchronize the timer and accelerometer