Accelerometer testing code