Game Development Reference
In-Depth Information
One-dimensional resistive touch sensor
To ease ourselves into this discussion, we will begin by looking at a one-dimensional
touch screen. Let's imagine we have built the machine described in Figure 20-1 .
Figure 20-1. Linear resistive touch sensor
As you can see, our sensor has two states, an open circuit state and a closed circuit
state . In the open circuit state, the controller is supplying a 5V signal to pin 2 and waiting
for any return voltage on pin 1. With no touch to bring the wires together, the circuit
is open. No voltage is present at pin 1, and therefore no touch is sensed. When the wires
are touched, they are brought together and the circuit is closed. A voltage will then be
present at pin 1. A touch event is registered.
This type of sensor, which looks only for the presence or absence of voltage without
regard to its value, is called a digital sensor . It can detect only two states: on or off (1 or
0, respectively). OK, so it's not quite a touch screen yet; essentially at this point all we
have is a simple button. Moving forward, let's say that we not only want to trigger an
event when we press our button, but we also want to simultaneously input a value based
on the location along the wire, L , that we pressed.
To accomplish this, the controller patiently waits for a voltage at pin 1. When it senses
a voltage, that digital “on” switch causes the controller to then probe the voltage that is
present, which we have labeled V X . Now we get to the reason it is called a resistive touch
sensor. Current, voltage, and resistance are all interrelated by Ohm's law. This physical
relationship is expressed as:
V = IR
Where V is voltage, I is current, and R is resistance. The exact physical meaning of each
of these is less important right now than how they are related, so don't get too worried
if you can't recall their definitions. In the case of our circuit, I , or current, is going to be

Custom Search