how to multiple buttons one function and 1 digital input

so I'm working on this project where I need 15 buttons.
Ive decided I only need to execute 5 different 'paths' with these 15 buttons.
Is it possible to hook up 3 buttons to one digital input and no matter which op the three is pressed the reading will be the same on my digital pin?

If you connect three buttons together in parallel, it will work as you want. If you are using the internal pullup resistors, connect one side of each button to the pin and connect the other side of each button to ground.

Whenever any of the three buttons is pressed, the pin will be low. If none of the buttons are pressed, the pin will be high.

If you connect three buttons together in parallel, it will work as you want. If you are using the internal pullup resistors, connect one side of each button to the pin and connect the other side of each button to ground.

Ive attached a picture of a schematic on how to do parallel switches, is this what you mean?
I find it somewhat confusing because they wire their buttons to an analog pin, will this work on a digital pin as well?
as of right now I have attached 5 individual buttons on individual pins using the other scheme.

No that is nothing like parallel connection. That's a resistor ladder that allows each switch to be identified. You said you didn't need to identify a particular switch so read the description in #1 again. A connection from each switch to one digital pin, the other side of each switch to ground.

Steve

No that is nothing like parallel connection. That's a resistor ladder that allows each switch to be identified. You said you didn't need to identify a particular switch so read the description in #1 again. A connection from each switch to one digital pin, the other side of each switch to ground.

thanks a bunch! this helped a lot, I googled a schematic for parallel buttons and that came up it seemed very different from what was described, que my confusion.

FYI, the analog pins can also function as digital pins.

I only need to execute 5 different 'paths'

If you change your mind and decide you need to know exactly which of the 15 buttons was pressed, it can still be done with only 5 pins (up to 20 buttons, in fact). But the method is quite complex, so be sure you really need it. A diode would be needed for each button, but no extra chips.

dougp:
FYI, the analog pins can also function as digital pins.

Not true for A6 and A7 on the pro mini, but true for A0 - A5 on all the arduino boards

That would be charlieplexing. Quite complex indeed. Much easier would be a 5x3 or 4x4 matrix (requiring 8 pins, but able to identify which pin(s) are pressed at any one time).

wvmarle:
Much easier would be a 5x3 or 4x4 matrix (requiring 8 pins, but able to identify which pin(s) are pressed at any one time).

With apologies to OP and others for going a wee bit OT, but seeing as wvmarle opened the door on matrix keypads. I bought one the other day, just to play, no real application in mind, and I'm wondering if there are any designs that don't eat up so many pins. An I2C version perhaps?

You could use a PCF8574 or MCP23008 port extender, 8 I/O pins, connects to I2C.
Or a PCF8575 or MCP23017 port extender for 16 I/O pins.
You can connect 8 of each to a single I2C bus so that way you can read a (4x16)x(4x16) = 4,096 button matrix on just 2 pins.
Doesn't sound practical, though.

An alternative may be to use shift registers. They take 2-3 pins.

If you change your mind and decide you need to know exactly which of the 15 buttons was pressed, it can still be done with only 5 pins (up to 20 buttons, in fact). But the method is quite complex, so be sure you really need it. A diode would be needed for each button, but no extra chips.

right now i have a deadline so i'm going for simple first, but I might try that later thank you!