Because it's analog, You'll have two analog reading through pins on the microcontroller to ascertain X and Y. Having an extra digital input will Permit you to browse the swap. This code reads the analog values from a joystick's X and Y pins, converts them into corresponding voltage values, and https://joystickcontroller40482.theobloggers.com/44657678/about-analog-joystick