Basic pinout on rotary encoder/Leanardo

Screen Shot 2022-06-30 at 6.11.43 PM
I am putting 5 pin encoders on the Leanardo. Pic included. I looked on the web for info on this but no one said outright what pin goes to what slot. Thats what I need to know.
What slot on the Leanardo does the SW go? And The DT and Clock..what slots do they go in?
I think I can figure out the Pos and Grnd.
Also the code I am using for this button box project needs to have the digital pins start at 0/1 and
go from there in sequence. And I am using 2 rows and 2 columns for a matrix. Please be specific and a diagram would be nice ..

Whatever suits the code. Do you know what these terms mean?

"SW" is the push switch. "DT" and "CLK" are entirely arbitrary names for the two quadrature terminals.

It would be appropriate to give a link for the actual module in question. There will be pull-ups to "+" for the quadrature terminals, there may be one on "SW".

This module is not particularly suitable for being in a matrix. What did you have in mind? :roll_eyes:

I have a similar module it had pull ups on the two quadrature outputs but nothing on the switch. I added a 10K resistor for the switch. Connected them to my nano, assigned the pins to them and it worked with the demo code. The code can be found using "example rotary switch code" as a search term.

Mind you, I believe you can use INPUT_PULLUP on a Leonardo. :grin:

I normally do not use them alone because the high impedance makes the wires more sensitive to noise. A 10K works great with the internal pull ups.

As mentioned above, please post full details of your code and project and also take some time to understand how a rotary encoder works.
Rotary encoder examples are not hard to find.

What is the purpose of the encoder in your project?
What is the purpose of the matrix?
How do you intend for them to fit with each other?

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