[Solved] Joystick without module help

Hi, Im a beginner who's just started using arduino. Had recently purchased a joystick which sadly was without a module like th eone attached in the picture. Please help me because everywhere i see a module is used. What connections can i do for them to be the same (soldering)?
I just want to have a joystick which have the same pins as the module
image
image
image

Show a picture of your joystick.
What do you consider the "module?"
Most hobby joysticks will have five pins for ground, power, x, y and select.

image

  • Connect both RED arrow to your 5V/3.3V
  • Connect both Black arrow to your GND
  • Green/Yellow are your X and Y data.

The four pins on the right are the same as a push button. So you can connect one pin to ground (e.g. black) and the opposite one (blue) to any digital port set as INPUT_PULLUP.

I suggest you to test these connections before soldering the joystick.

Got a stupid question
What happens if i supply 5v instead of ground to switch and use input function?

The switch already receives +5V and ground. Iverting positions will only invert the result at analog read. But if you´re talking about the button, you´ll need to add a pull down resistor between the Arduino pin where the button is connected and the GND. Also change the sketch to read HIGH when the button is pressed.

Thanks