looking for recommendation for selector knob

colorado_hick

Well-known member
I have an application where I want to have some way to select one of 16 options.
Right now I am using an eleven detent potentiometer which is cool cause it only uses one analog read pin but it was also a pain to tune because the voltage value I would choose as a step would sometimes be a different step. Probably has to do with the temperature and how much power I am getting from the power supply? and it is only 11 options.
Atheistically I rather not go with a display and rotary selector.
Is there another solution? Im running short of pins....
 
I've used a 12-position rotary switch as an input. I put 1K resistors between each terminal, creating a voltage divider. The last terminal goes to ground, the first terminal through another 1K resistor to +3.3v. The wiper goes to an analog input. I used a tree of "if" statements to detect the position, choosing analog values 1/2 way between the steps. If the sampled analog value is greater than the half-way point, the selected position is the next higher value.
 
Back
Top