So heres the deal, I have a project that im doing that requires me to have buttons numbering 0 to 9 (10 buttons) and whenever you press the corresponding button it will be displayed on a four number led display that looks like this: http://handyboard.com/cricket/bus/4digit/4dkb-sm.jpg but just the led portion without the PCB.
My question is if there is a way to make it so i could read those 10 buttons each separately without having to have 10 pins used. AND//OR with the LED number display it has 12 pins, 11 of which ill use, is there a way to reduce the number of pins for the led display with easy accessible parts? Otherwise the code ive written for the number display is intended for the use of 11 pins -_- which takes up a big chunk.
You could do it with 1 or two analogue pins with the switches short circuiting a multi stage voltage divider. You might be able to do it with 1 if you hand tuned it to your resisters, it would be dead easy with 2 pins and 5 on each. There was somebody flogging an LCD shield with 5 buttons that used 1 analogue pin on ebay a while back.
You could get an I/O expander. Try the MCP23016 - you get 16 pins that can be programmed to be inputs or outputs all connected through the two pins of the I2C bus. I just bought these, i haven't used them yet but i read good things about em. Heres a link on a project using these chips; http://www.neufeld.newton.ks.us/electronics/?p=241