A quick update adding a feature of ignoring minor acceleration. The value I gave must be tested later and tweaked until it's big enough to keep the ball still when the phone is left lying around, but small enough to not make the user have to tilt their phone too much to get a response from the ball.