As it's analog, You will need two analog looking through pins on your own microcontroller to determine X and Y. Having an additional electronic enter will Permit you to read the swap. Notice that this example assumes you are employing an Arduino-suitable board that supports the Joystick library, like the https://deanpmjui.therainblog.com/36888918/the-smart-trick-of-arcade-joystick-that-nobody-is-discussing