Implement gravity sensor.