Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When I add Joystick.sliderLeft(analogRead(x)) the button don't work anymore #110

Open
meilleur102 opened this issue Mar 31, 2022 · 0 comments

Comments

@meilleur102
Copy link

meilleur102 commented Mar 31, 2022

I have a problem when I add a Joystick.
I have a potentiometer plug into one Input and I have 3.3V and ground plugged on the other 2 connector of the potentiometer.
When I write in the code (anywhere). I try to hard code the value and still the button don't work

Joystick.sliderLeft(analogRead(x));

The slider work but the button don't work anymore.
I have 2 rotary encoder that work perfectly when I remove this part of the code.

Here's my loop (the function for the CheckEncoder and ReadMatrix work when the Joystick.SliderLeft is commented

void loop() {  
  // put your main code here, to run repeatedly:
  isBtnPress = false;
  
  CheckAllEncoders();
  ReadMatrix();
  if(isBtnPress == true){
    ActivateBtns();
    }
  Joystick.sliderLeft(50);
}


EDIT:

I just realise that even when the slider is not in the code when I first open the Game Controller I have the 2 slider at 50% and as soon as I press a button (rotary Encoder) the slider go back to 0

BEFORE PRESSING A BUTTON
image

AFTER PRESSING A BUTTON
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant