Because it's analog, you'll need two analog studying pins on the microcontroller to find out X and Y. Having an extra digital input will Enable you to go through the switch. The joystick values are then printed on the serial check, with a little hold off amongst Each individual examining. https://diy-arcade-parts53968.blogars.com/36857824/new-step-by-step-map-for-arcade-joystick