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

Encoder Change is Inverted #85

Closed
WarMacre opened this issue Nov 2, 2024 · 2 comments
Closed

Encoder Change is Inverted #85

WarMacre opened this issue Nov 2, 2024 · 2 comments

Comments

@WarMacre
Copy link

WarMacre commented Nov 2, 2024

On the encoder that I am using (Chinese KY-040 Module), turning clockwise reduces the changed amount and visa-versa. Is there a way to switch this? If not, can I request an addition to the next build to invert the change amount?

@Steve8291
Copy link

The CLK and DT pins are reversed on that module. You have two options. Do one or the other but not both:

  1. Reverse the A and B pin variables you pass when make an instance of the enocder like
AiEsp32RotaryEncoder rotaryEncoder = AiEsp32RotaryEncoder(ROTARY_ENCODER_B_PIN, ROTARY_ENCODER_A_PIN, ROTARY_ENCODER_BUTTON_PIN, ROTARY_ENCODER_VCC_PIN, ROTARY_ENCODER_STEPS);`
  1. Reverse the A and B pin defines:
    If you had
#define ROTARY_ENCODER_A_PIN 32
#define ROTARY_ENCODER_B_PIN 21

Change it to

#define ROTARY_ENCODER_B_PIN 32
#define ROTARY_ENCODER_A_PIN 21

@igorantolic
Copy link
Owner

Closing since not code issue but rather adjusting for different HW as answered

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

3 participants