Because it's analog, you'll need two analog examining pins on the microcontroller to determine X and Y. Acquiring an extra digital input will Allow you to study the switch. Notice that this example assumes you will be working with an Arduino-suitable board that supports the Joystick library, including the Arduino https://arcadejoystick69134.arwebo.com/60404085/indicators-on-arcade-joystick-you-should-know