2
2
20strannik082018-12-12 19:10:14
Electronics
20strannik08, 2018-12-12 19:10:14

How to connect multiple buttons to one pin of Raspberry pi?

I can’t catch up ... It’s worth Raspberry pi 3 B. Almost all the pins are used by stepper motors. A couple of pins remained free, but you need to plant about seven buttons and the same number of LEDs. How can I implement it in such a way that all these buttons would sit on 1 pin? So that when each of them is pressed, a signal is transmitted that the raspberry could recognize depending on the button pressed? Similarly with LEDs, so that a def. signal, and the corresponding LED lights up.
There is some self-made automatic device, which is controlled by a python 2.7 script. But I'm already tired of running it every time from the laptop terminal, which connects to the raspberry via wifi. I would like to bring this in the form of buttons to bring to the front of the device itself, and next to each button there is an LED signaling that the script corresponding to the button pressed, etc. is being executed ... Set it to true dear)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Viktor, 2018-12-12
@20strannik08

a couple of pins
to one pin
If indeed to one, then this is a 1-Wire connected interface, Google does not recommend anything for it. But if there are two pins, then this is already I2C, and under it there is a port expander MCP23017 .

D
Denis, 2019-01-16
@Norkotik

Buttons through resistors of different ratings?
In the car, the buttons on the steering wheel are connected like this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question