As TomGeorge said, you need to adapt your code for each pot.
Each pot needs a zero point and two span ranges mapped to 0-255.
Start with simple code that reads the A/D value of the pot.
Find the A/D value of the center position.
Find the values of the two extremes.
Pick a dead-band range, e.g. +/- 8.
Map the two spans you have to 0-255.
Leo..
Example.
If you mechanically adjust/rotate the pot, so that the center postion of the joystock is about A/D value 512.
And you want a +/- 8 deadband.
And the pot extremes are 100 and 923.
Wawa:
Example.
If you mechanically adjust/rotate the pot, so that the center postion of the joystock is about A/D value 512.
And you want a +/- 8 deadband.
And the pot extremes are 100 and 923.
Thanks so much for your help Leo So are you suggesting I close up the dead band from 20 down to 8 yeah? cause the Pot extremes aren't reached when its assembled so I'm having to account for this in the code..