i'm used to expand digital outputs using the 74HC595, also cascading them, easily as you know.
Now i have the need to expand my digital inputs, and i would like to be in a similar easy cascading way of doing it.
I have read about several methods to do this: 4051 (but as i understood, it takes away one analog pin on my arduino for each 4051 cascaded), 4021 (didn't understando which is the difference between this and the 4051) and 74HC165 shiftin.
To me the last one (74HC165) seems to be the most similar to the 595 approach; from what i've understood, i'll use three digital pins only from my arduino, despite the number of 74HC165 attached and cascaded. Is this right ? Is it easily supported by arduino code (maybe with some ready library ?)..
Which is the best method ? I plan to have, finally in my project, at least three sets of 8 digital inputs; i need to have them cascaded because i need to have identical modular circuits to expand the project if needed.
Thanks very much in advance.