Keypad program runs on OS2. Extended not only 3x4 but 4x4,4x5 and 5x5 keys.
see /users/kenjiArai/notebook/keypadkey-matrix--control/
Diff: key_complex.cpp
- Revision:
- 3:8a7b6370956f
- Parent:
- 2:d0ae519c229c
--- a/key_complex.cpp Mon Apr 06 04:59:45 2020 +0000 +++ b/key_complex.cpp Mon Apr 13 02:07:27 2020 +0000 @@ -5,7 +5,7 @@ * http://www7b.biglobe.ne.jp/~kenjia/ * https://os.mbed.com/users/kenjiArai/ * Created: April 5th, 2020 - * Revised: April 6th, 2020 + * Revised: April 13th, 2020 */ // Pre-selection -------------------------------------------------------------- @@ -29,8 +29,8 @@ DigitalOut led1(A1); DigitalOut led2(A2); Serial pc(USBTX,USBRX); -// X Y Z W V A B C D E OUT(XYZWV), IN(ABCDE) -Keypad key(D6, D5, D4, D3, D2, D11, D10, D9, D8, D7); +// X Y Z W V A B C D E OUT(XYZWV), IN(ABCDE) +Keypad key(D11, D10, D9, D8, D7, D6, D5, D4, D3, D2); // RAM ------------------------------------------------------------------------ @@ -56,7 +56,7 @@ uint32_t key_num; uint32_t counter = 0; - pc.printf("Start Key-Pad test\r\n"); + pc.printf("Start Key-Pad test 5x5 keys and/or state hold switch\r\n"); while(true) { while ((key_num = key.read()) != 0) { pc.printf("%2u:[%2d] %c\r\n",