Using as little pins as possible for multiple buttons
You could use the good, old, R2R DAC:







simulate this circuit &ndash; Schematic created using CircuitLab

All r should be small enough wrt to R to pull down the push button output when it is released. Some good values you can start with are:


\$r=1k\Omega\$
\$R=47k\Omega\$
\$2R=100k\Omega\$


Better yet, use one \$100k\Omega\$ resistor for R and two of them in series for the 2R resistor.

I will not dig in how this circuit works, refer to wikipedia for an explaination, what you want to know is that if we associate a digital number to the push button states, the output voltage is an analog representation of such number.

If the button is pressed, we say it is 1, if it is not pressed we say it is 0. SW1 is the LSB, i.e. the rightmost bit, while SW6 is the MSB, i.e. the leftmost.

As an example, if you press SW6, 3 and 2 the digital number is \$D=100110\$, which in decimal is 38.

The output voltage depends on \$V_{dd}\$ and is:
$$
V_{out}=V_{dd}\frac{D}{2^N}
$$
where N is the number of switches, in this case 6.

You can sample the analog voltage with the arduino ADC and then convert it back to a digital representation of the status.

Since you have an eight bit converter, the routine will be pretty neat:

uint_8t sw_status;
while(1) {
  sw_status = adc_read() &gt;&gt; 2;
  // do something with sw_status. the lsb represents SW1, and so on, e.g.:
  if (sw_status &amp; (1 &lt;&lt; 3)) {
    //SW3 is pressed here!
  }
}


There are some problems with this. First of all, you need precise resistors, or you will get non monotonic behavior which is very bad. The ADC on the nano should be precise enough, but you need to check if it accepts rail to rail inputs. And you get some error because you do not have SPDT push buttons, and you need to use the pull down. Moreover, if you have long wires going to the console, you will probably need to buffer the signal to avoid spurious reads.

All in all this works, requires not many components but is suboptimal at the least. I would definitely go for i2c IO expanders. But this solution is pretty neat and a bit out of the box, and deserves some evaluating.