I am trying to use the CD74HC4067 multiplexer along with push buttons. The idea is to have 16 push buttons and use as least pins possible on the arduino. I found some guides for using CD74HC4067 but all of them seem to focus only on output to the 16 channels instrad of using the 16 channels as inputs. In the end I have not been able to find any guide about using the multiplexer for input buttons.
As I am not very experienced, I am not very sure how to use the multiplexer for input. I am not sure if it is correct but from what I understand for the arduino to read a channel it needs to have the control pins at a certain configuration (high or low). My concern with this is that if I press a button connected to the channel 0, this will only be able to be read if the control pins are all low (equivalent to channel 0 selected). But even if the arduino is looping through the different channels, wouldnt it miss an input button pressed because the control pins are not at that moment at the correct channel?
All in all if the multiplexer is not the best option for inputs, maybe I should go for mulitple push buttons on a single analog pin, with each button a different resistor to diferentiate the resulting analog value.
I was wondering if anyone has used this multiplexer successfully along with push buttons. For now what I really need is to have a working code that will serial.print when each of the buttons is pressed.