Connection Switch

Hi. Can anybody help me with a wiring diagram . I want to make a project with an Arduino uno, this switch and three led. When I slide the switch, I want to turn on one single led. Thank you.


The switch has four pins three positions. What pins are connected at each position? Can't tell from a picture of the outside of the switch.

My guess is that the single pin is connected to one of the three grouped pins in each position. If that is the case you don't need an Arduino at all. Just connect the switch between Power or Ground and each of the three LEDs.

If you really WANT to use an Arduino, I think the best way to read the switch is to connect the separate pin to Ground and connect the three grouped pins to three digital input pins set to pinMode: INPUT_PULLUP. When you read those three pins, the one that reads as LOW will indicate the position of the switch.