Go Down

Topic: Connection Switch (Read 177 times) previous topic - next topic

AlexSD

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.

johnwasser

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.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp
See who has no social life: https://forum.arduino.cc/index.php?action=stats :)

johnwasser

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.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp
See who has no social life: https://forum.arduino.cc/index.php?action=stats :)

Go Up