Because the joystick is moved, the potentiometers’ resistance variations, resulting in varying voltage stages that can be go through by a microcontroller or other processing unit. Note that this instance assumes you are making use of an Arduino-compatible board that supports the Joystick library, such as the Arduino Leonardo or https://chanceicnvb.p2blogs.com/36654667/arcade-joystick-secrets