Joystick huge outer deadzone

This may not be the correct board, please feel free to move me to the correct one. Could not figure out which would be best.

So the joystick reads fine and everything, but there is a huge outer dead zone.
I have looked and found some scripts to calibrate, but nothing seems to work to eliminate the outer dead zone.

#define JOYSTICK_DEADZONE  (30)
#define JOYSTICK_BUTTON    (2)


void setup() {
                     // get ready to send reports on the serial connection.
                     // make sure your serial window is set to this baud rate
  Serial.begin(57600);
                     // prepare the button
  pinMode(JOYSTICK_BUTTON,INPUT);
}

void loop() {
  int ox = analogRead(A0);
  int oy = analogRead(A1);
                     // FYI: output = map(intput,from low,from high,to low,to high)
  int mx = map(ox,0,1023,-512,512);
  int my = map(oy,0,1023,-512,512);

  int dx = abs(mx) < JOYSTICK_DEADZONE ? 0 : mx;
  int dy = abs(my) < JOYSTICK_DEADZONE ? 0 : my;

  int b = digitalRead(JOYSTICK_BUTTON);

  Serial.print(ox);  Serial.print('\t');
  Serial.print(oy);  Serial.print('\t');
  Serial.print(mx);  Serial.print('\t');
  Serial.print(my);  Serial.print('\t');
  Serial.print(dx);  Serial.print('\t');
  Serial.print(dy);  Serial.print('\t');
  Serial.print(b );  Serial.print('\n');

  delay(50);
}

Just read the analog value and print the 'raw' value, you MAY find it has a dead zone. Software will not help!

there is 100% a dead zone. Only about half the joystick works. So there is no way to fix that?

measure resistance with ohmmeter, if you find that it doesn’t change after half way you could throw the joystick in the bin and get a better one because there is nothing you could to

I tried :frowning: thank you for the help.

I have tried numerous joysticks. All different kinds. Even pulled some out of a working controller. They all have the same outer deadzone. I have to be missing something.

I see you print the raw values, are they not plausible?

Please post a schematic.

Did you measure the potentiometer directly with you ohm meter?

Do all the joysticks you've tried show the same dead zone when just examined with the meter, no other circuitry?

a7

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.