A shift register : http://arduino.cc/en/tutorial/ShiftOut
I know about shift registers, but i want to do it without much external circuitry.
dio1 dio2 dio3 dio4 |--btn1--|---btn2--|--btn3--| |-------btn4-------| | |-----------------btn5------|
As per pico's suggestion with diodes and external pull-ups installed:
If he doesn't want to use even wire, I give up.
Here is an interesting challenge for you:
I have only 4 digital I/O lines left on my Arduino; the others were taken up by other things. I was wondering if there is a way, using minimal external circuitry, to read 5 buttons with these 4 I/O lines, assuming I have power and ground as well?
I can read the state of up to 7 switches with 4 digital lines. No extra components needed.
Only caveat: they need to be pressed individually. Pressing more than one at a time would produce an invalid result and that data would need to be discarded.
Want to know how, or are you just testing us?
Hello Krupski,I hope your SPI interface project worked out ok.QuoteI can read the state of up to 7 switches with 4 digital lines. No extra components needed.You sure can ... 3 SPDT switches, 3 DPDT switches and 1 3PDT switch.QuoteOnly caveat: they need to be pressed individually. Pressing more than one at a time would produce an invalid result and that data would need to be discarded.AbsolutelyQuoteWant to know how, or are you just testing us?Confused. I still find pico's comment rather humorous (and so did he with "smiley-mr-green").As for my previous circuit suggestion, I've assumed single pole normally open push buttons. Then added external 10K pullups to provide greater signal strength and noise tolerance. The diodes are to isolate the switching of multiple lines.