As it's analog, you'll need two analog looking through pins in your microcontroller to find out X and Y. Possessing an additional electronic enter will Enable you to examine the switch. This code reads the analog values from a joystick's X and Y pins, converts them into corresponding voltage values, https://titusnfhed.like-blogs.com/37928676/the-smart-trick-of-arcade-joystick-that-nobody-is-discussing