Hi Reiner,
Your wiring looks ok.
The pot will be expecting to turn about 270 degree to get the full range, from the picture I don't think that mechanism will be able to turn the full range so your 660-1023 may be as good as you will get?
You can use the map function to re-map your available range (660-1023) to something else (say 0-255) e.g. x_new=map (x, 660, 1023, 0, 255);
cheers, Paul
Thought I would mention that when I did some of my remote control work, like updated firmware for the Arbotix Commander or for a DIY remote control, I did the mapping of the analog input data two different ways, depending on if the joystick axis was centering or non-centering (throttle).
The code had a mode to turn on a calibration mode, where I move all of the different joysicks, pots, sliders...) from top and bottom of range. Note on joysticks I would typically go only up/down left/right and not the different diagonal ones as I wanted moving straight up to give me the full max (or min)... And for the centering axis, I would also capture the rest positions...
Also note, in the old code, I would keep running sums for the last N samples (in the one I looking at 8)...
As you mentioned doing USB joystick I think. I believe the range for them is 0-1023 (10 bit)
My Joystick reading would after getting the new value (in my case the sum/8), I would check to see if value > MAX_FOR_THAT_AXIS and set output to 1023 (or 0), likewise if < MIN.. set to 0(1023)
As @houtson mentioned for throttle like axis I would do something similar to what he mentioned other than I would change to: x_new=map (x, 660, 1023, 0,
1023);
For centering like joysticks, depending on how accurate it always comes back to logical 0, I would have a settable (either hard coded or user changeable) center slop factor.
And then if (VAL-MID_POINT) < SLOP_VALUE then set output to 512
Also ran into issue where Center point was not truly center of range. So I would do two mapping. Something like:
if (x < center) new_x = map(x, min, center, 0, 512);
else new_x = map(x, center, max, 512, 1023);
Again sorry if this is not related to what you are asking.