Homework 9


Downloads

BallDone

Aim

This homework will get you to work with the accelerometer API and think about processing accelerometer data.

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.

Due

Tuesday April 7, at 6:30PM

Submission

LabFusion (delete the build directory and zip the project directory)

Back to the main page