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
Is QMK compatible with optical encoders? #6856
Comments
Well, we have support for rotary encoders: A quick look and this may work the same? Do you have a sample for arduino code? |
Thank you for the reply. Yes, I know QMK supports encoders and I’ve looked at the code. But my point is that optical encoders work a bit differently than normal drag contact encoders. It uses an LED, two photo transistors and an interrupter wheel to generate the signal. With normal encoders you can connect the common pin of A and B to whatever you want but an optical encoder seems to behave as if the common pin is connected to VCC. And there is nothing I can change about it since everything is in a dust proof package. |
Sorry, on a second reading I think you understood what I meant. ^^ Would perhaps changing:
To:
On line 68/69 in encoder.c be enough? |
You probably wouldn't change the values, you would just add a define around the existing behavior so that when you set ENABLE_OPTICAL_ENCODERS in your config.h it would use that code instead of the default. You'll have to test it out of course first with actual hardware before we would accept it. |
I will but I am far away from it yet.^^ |
If yan is right about that, then yeah, it should. You'd just need to change the code in |
Did you get anywhere with this? I'm having trouble with a rotary encoder that I think is an EC11 but I'm not sure. I followed the thread above to modify the encoder.c file but it is still unresponsive. I've also laid the whole thing out on a breadboard, swapped A and B lines, and changed the encoder resolution but nothing seems to work. |
This issue has been automatically closed because it has not had any recent activity. |
The documentation says to connect the common pin of an encoder to ground but all optical encoders that I’ve found seem to connect their optical transistors to VCC.
https://static6.arrow.com/aropdfconversion/b37bee95f5eae7e7f00cc37d7f45757e265dbb6b/50924574275363em14.pdf
Would that still be compatible without messing with extra transistors? Do I need to change the Firmware? In Arduino I’d know that I just had to change HIGH to LOW somewhere but the syntax of proper C has me a bit confused.
Also, I can't really test this. Since this is a quite pricy component, I wanted to ask before buying.
The text was updated successfully, but these errors were encountered: