A medical device includes a housing. A sensor, such as an accelerometer, a magnetic field sensor such as a Hall sensor, and/or a gyroscope, provides a sensor signal in response to a translation of the housing and/or a rotation of the housing. A controller controls the medical device, based at least in part, on the sensor signal.