
87Chapter 5: The Joy of Joysticks
we can measure not only the knob’s location in
360 degrees but also how far the knob is being
pushed.
Most simple joystick modules have five
pins. Remember what we learned about
potentiometers: The typical one has three pins.
But wouldn’t that mean we need a minimum of
six pins? Not quite. Because positive-voltage
and ground pins do not have any data associated
with them, they can be tied together, so each
potentiometer shares a 5 V and a GND pin. That
leaves us with four pins: 5 V, GND, x, and y.
What about our last pin—pin number 5? It is
usually associated with the integrated button
within the joystick. Most ...