Code sample on how to use the accelerometer