Hi, I want to use the interrupt method for a switch in rotary encoder but I have found a bouncing problem, so after searching, I have found this code, but I don't know if it's good or there are other better solutions
If you're talking about the actual encoder function, check out this interrupt-driven encoder library I've been working on: GitHub - gfvalvo/NewEncoder: Rotary Encoder Library
It handles debounce without timing delays. Both encoder pins must be connected to interrupt-capable inputs on your board.
If you're talking about the push button switch on many encoders (the extra two pins), then don't bother with interrupts, just use the Bounce2 library.
gfvalvo:
If you're talking about the push button switch on many encoders (the extra two pins), then don't bother with interrupts, just use the Bounce2 library.
Yes this what i'm talking about , so the best solution is using the Bounce library