Since the joystick is moved, the potentiometers’ resistance adjustments, resulting in varying voltage levels that could be examine by a microcontroller or other processing device. Be aware that this example assumes you happen to be making use of an Arduino-appropriate board that supports the Joystick library, such as the Arduino https://israelpljwu.dm-blog.com/38239143/the-basic-principles-of-arcade-joystick