As it's analog, you'll need two analog reading through pins in your microcontroller to find out X and Y. Acquiring an extra digital enter will Allow you to browse the switch. Note that this instance assumes you are working with an Arduino-suitable board that supports the Joystick library, like the https://richardn664iih2.wiki-cms.com/user