I am just starting to get into this and have a question on a selection dial. From what I have been reading I have two options, either potentiometer or encoder. I am looking for something that will have 4 selections/positions that will have a click when you switch, I believe they are called detents (so thinking I would need 3 detents). I do not need the dial to go all the around so I think that I am looking for a potentiometer. The first part of the project to just get something working is have 4 led. In position 1, 1 led will light up. Position 2, 2 leds will light up and so on. It should also know in what position it is when power is lost and comes back.
I googled as much as I could. Any help or a point in the right direction would be great.
No two at the most. Wire them up in a binary switch combination. Use two poles of the switch with the common wiper connected to ground. Then wire positions 3 and 4 of one pole to one pin, and positions 2 and 4 to the other pin.
You can even use one pin if it an analog pin. Have three 10K resistors in series between 5V and ground. Connect the common switch pin to the analogue input, and the four select positions to the four points of the resistor chain. That is 5V, below R1, below R2, and ground.
Cool thanks Grumpy_Mike. I guess like I have a lot more reading to do on this stuff.
Now that you pointed me in a direction I did some searches for 4-way switches and I found this
I know that this is a 5-way switch that does not stay in the direction, but I do not need to click threw it. By default it can be 1 led, up is 2, left is 3 and right is 4. What I can use the middle for is like an blinking option. It would be a lot quick to cycle threw options
The analog would then have 4 10k resistors then right? I don't know how you would hook it up non analog.
Is there a good article that i can read about the difference/benefits of analog and digital on arduino.
The analog would then have 4 10k resistors then right?
No, 3 resistors giving you four nodes.
I know that this is a 5-way switch that does not stay in the direction
I used one of those a couple of weeks ago and I was not impressed. First off the contacts only work when you push the switch diagonally and secondly they did not always work. To make matters worse they are not on a 0.1" grid so they are hard to mount. I would avoid them.
I don't know how you would hook it up non analog.
I did say in reply #3 :-
Use two poles of the switch with the common wiper connected to ground. Then wire positions 3 and 4 of one pole to one pin, and positions 2 and 4 to the other pin.
Sorry for the confusion. I was talking about if I went to the 5 way switch.
Thanks for the heads up on at switch. I'll keep on looking. I think something like an analog stick will be better now that i am thinking of it. I am liking the quick switching and not having to go threw all the other options.
I was talking about if I went to the 5 way switch.
OK note that the 5 way switch is only a single pole and so you are stuck with either a separate input for each direction or an analogue implementation.