Real Newwbie needs to understand :-)

Hi everyone!
I just bought my first arduino! I am a computer programmer but I am also ZERO in electronics (lol)
I would like to understand one simple thing. if I have to use multiple buttons, one lcd display, and various other "peripherals" connected to my arduino board... can I use the same input channel for multiple "purpose"? My question came natural when I first used the LCD and wanted to "control" the data displayed using 6 buttons (4 arrows buttons, 1 "enter" and 1 "back" buttons)... let's suppose I need to connect many "inputs" more than the ports number... how to do it?
I understand that my question is pretty stupid but it's my very first time into electronics and I need to start up and understand :smiley:
Thanks in advance!

How many inputs ?

Welcome to the group.

Which Arduino do you have?

You can attach port expanders if you need more inputs/outputs.

Different Arduinos have different port pin counts.

BTW, always best to show us, in a schematic, what you are proposing to make.

I understand that my question is pretty stupid but it's my very first time into electronics

I think Larry will agree with me that as 'first questions' go, that was one of smarter ones...

(and you have to trust me when I say we don't give out compliments to just anybody...)

The only way to use several buttons on the same pin and to differentiate what button is pressed is to use an analogue pin and a resistor ladder. Like the one shown here:-
https://forum.arduino.cc/index.php?topic=440200.msg3032387#msg3032387

I agree with mike.

I did a quick google search and came up with this :

This is also interesting:
http://www.circuitbasics.com/how-to-set-up-a-keypad-on-an-arduino/

larryd:
Welcome to the group.

Which Arduino do you have?

You can attach port expanders if you need more inputs/outputs.

Different Arduinos have different port pin counts.

BTW, always best to show us, in a schematic, what you are proposing to make.

no Schema at all by now, I was just "thinking" what could be done with an Arduino while executing the exercize proposed with the starter kit (the LCD one). when it was done I noticed that 5 inputs were used by the LCD and the question came itself: "and... what if I want to use a wifi shield, keypad, rfid shield and sd reader/writer all together???". that's it.

I am curious about Port Expander... can u tell me more?

raschemmel:
I think Larry will agree with me that as 'first questions' go, that was one of smarter ones...

(and you have to trust me when I say we don't give out compliments to just anybody...)

lol, thank you very much for your compliment. :slight_smile:
As I said, I am a computer programmer (since 1991!! yes! ok! I am OLD!...lol ) and a very curious person. When I catch an interesting thing, I need to know more... and more... and more.
There aren't things that can't be done... there are only things you DON'T WANT to do.
This is how I am and that's why I'm here! :wink:

I am curious about Port Expander... can u tell me more?

Google the words
Arduino Port Expander
for examples of the chips and the ready built boards you can get with them on.

There are two basic ways of interfacing port expanders with the Arduino, they are called I2C and SPI. Both are buses, meaning the same pins will support more than one of each device on them.

The I2C ( pronounced eye squared cee ) uses two signal wires and normally runs at about 100K bits / second.
The SPI uses four or five wires depending on if you need an input from the chip as well as an output, but runs a lot faster, typically 2M bits per second.

You can also use chips called shift registers for a chain of input only or output only connections. The input or output depends on the shift register chip type. These only need two Arduino pins to drive.

4051 analog mux/remix

165 input shift register

595 output shift register

MCP23017

port expander
https://www.google.com/search?q=arduino+port+expander&rlz=1C9BKJA_enCA832CA832&oq=arduino+port+expander&aqs=chrome..69i57j0l3.7984j0j7&hl=en-US&sourceid=chrome-mobile&ie=UTF-8

TMI (his brain might explode)