I'll probably have 6 or 7 different switches, and don't want to tie up that many pins if I don't have to. I'm planning on having a microSD reader attached, various LEDs, and perhaps other things as well. This is still in the brainstorming stage so everything's on the table so to speak.
Are they SPST? Or are they actually SPDT? How many terminals does each switch have? If they are SPDT, you can build an R/2R resistor ladder and feed that to an analog input.
For sounds effects/noises? I would recommend a dfplayer mini rather than an SD card reader. Easier to use, similar size, built-in amplifier, much better quality output.
I gets a bit complicated to sense multiple switches on or off with the analog approach.
If you want to minimize the number of pins used by the switches and LEDs you could use I2C expanders like the MCP23008 (8 GPIO) or MCP23017 16 GPIO). They have 8 or 16 GPIO pins that can be configured, independently, as input or output. There are internal pullups available on every pin and pin change interrupt on each pin.
Each switch connects a given (different) resistor to ground from the analog input. You have a pull-up resistor to Vcc whose value is toward the middle of the binary sequence of resistor values (110, 220, 470, 1k, 2k2, 4k7, 10k), so say 1k.
If you want to save current, you connect the pull-up to a control pin instead of Vcc and only pull it up when you want to read the switches.
This should work with up to seven switches allowing you to actually figure out which switches are operated at any given time, though you may need to adjust the resistor values.
Thanks for that. I'll set up a test scenario to help get my head around the concept, but, if, say, every switch was "on" (i.e. closed), and I read the analog input, wouldn't it just read the lowest resistance figure, as if the only closed switch was the first one? In other words, would this only work if lower resistance switches had been turned off? (Sorry for all the questions; I'm still learning.)
No, every combination of the switch settings would give a different resistance, because the resistor values would combine, either in series or parallel (not sure which @Paul_B is suggesting).
If you read my description you will see it suggests each of the (series) resistor/ switch pairs is in parallel with the others, all between the analog input and ground,
Of course you can alternately put all the resistors in series, and have each switch bridge one of them (except the pull-up).