Patent ID: 8917883

Claim:
A system adapted to control an electronic device, the system comprising: an audio accessory coupled to the electronic device, the audio accessory having at least one speaker adapted to provide audio output and a plurality of resistive switches, each switch having a selected resistance; and the electronic device having a bias voltage source adapted to provide power to the resistive switches via a bias resistor and a ground connection, and a measurement module adapted to: (a) monitor a bias point on a connection between the bias voltage source and the resistive switches to determine when at least one of the switches has been engaged, (b) at least once while that switch is engaged, activate and deactivate the bias voltage source, taking a first measurement of the bias point while the bias voltage source is activated and a second measurement of the bias point while the bias voltage source is deactivated, (c) determine a ground offset voltage caused by the audio output based on the second measurement, (d) compensate for the ground offset voltage caused by the audio output based on a voltage difference between the first and second measurements, and (e) determine which of the switches has been engaged based on the voltage difference.