Because it's analog, you'll need two analog studying pins on the microcontroller to ascertain X and Y. Getting an extra digital input will Permit you to examine the change. Take note that this example assumes you happen to be applying an Arduino-suitable board that supports the Joystick library, including the https://rafaeluxwvt.ka-blogs.com/91338429/analog-joystick-fundamentals-explained