Since it's analog, you'll need two analog reading through pins on the microcontroller to determine X and Y. Having an additional digital enter will Enable you to go through the change. Note that this example assumes you're working with an Arduino-suitable board that supports the Joystick library, including the Arduino https://stevef788uyy9.vigilwiki.com/user