Fixed accelerometer and tilt code