So, how does a matrix finally works? If you have understand the previous example, then it will be very easy for you to follow. The matrix is controlled by a microcontroller. For the above 16-button 4x4 matrix, 8 pins of the micro controller will be used. The first 4 pins will be OUTPUTS and will be connected to the COLUMN wires, while the other 4 pins will be INPUTS and will be connected to the ROW wires. The OUTPUTS of the microcontroller will NOT all have power at the same time. The outputs will go high one by one in cycle. This happens many times per second, but i will slow things down...