You can't connect the joystick directly to the PI's GPIOs, you need an ADC chip in-between.
Take a look at https://grantwinney.com/connecting-an-analog-joystick-to-the-raspberry-pi-and-using-it-with-an-rgb-led-to-simulate-a-color-wheel/, which uses an MCP 3008 to connect a joystick to the PI.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.