For the pot. the pin in the middle is the output voltage to be measured. The two pins on the sides is connected to ground and +5V. If you switch the cables, you switch the direction.
You can use a 10K-100KOhm potentiometer. Only use linear
for further info on how the joystick - port is connected search on google.