Hello,
in school we are programming a microcontroller. We have now a homework, that we have to learn how to controll the 4x4 Matrix Keyboard on the Microcontroller.
Here how it looks like:
P6.4 P6.5 P6.6 P6.7 P8.3 A1 A2 A3 A4 P8.2 B1 B2 B3 B4 P8.1 C1 C2 C3 C4 P8.0 D1 D2 D3 D4
For example if A1 is pressed P8.3 = 0 and P6.4 = 0.
I try it on many ways to controll it, when someone press a button, but i cant find out how it work.
I use for example this Code.
Thanks for help
if ((P6 & 0x01F)== 0x0E0 && (P8 & 0x0F8) == 0x07) {
.....
}
Hint: set one row to logic high and scan all columns. Continue with next row.