| Task |
Modify Ball so that the ball isn't affected by accelerometer events until the
user has shaken the device. That is, initially, nothing happens to the ball if
you tilt the device, but once you shake it, the ball starts rolling around
under the influence of gravity. So basically, "shake to start".
|
| Hints |
This homework is a little more challenging than usual.
Get Apple's AccelerometerGraph
(requires login) sample code and use it to observe what happens
when the device is shaken. Use this information to figure out a good "shake"
criterion.
For a case like this, it's best to use a high-pass filter to eliminate the
influence of gravity. AccelerometerGraph implements a high-pass filter.
|