What is the name of this kind of switch?

One resistor less than the number of steps.
(On the picture there are 11 resistors for 12 steps, and 5 Rs for 6 steps)
The Rs value doesn’t matter much, anything from 1K to 10K should be OK.
Just be sure they are all the same so you get equal steps.

2 Likes

Someone else asked about how to calculate the resistor values over here:

1 Like

It works!
I connected the pot output to an LED and it works as a voltage divider!
Now I’m struggling to write the Arduino script, do you know that language? :sweat_smile:

I have downloaded this script from the internet. It is based on an example that uses rotary switches.
I can kind of get what it does, but I can’t get it to output the rotary position.

1 Like

No, that’s not good, it connected each pin of the switch to a digital input of the arduino (the first 4 as it only uses four steps).
You should connect the middle pin (pin A) to an analog input and read it as an analog value.
Something like this :

1 Like