3x4 keypad library (Extended not only 3x4 but 4x4,4x5 and 5x5 keys)
Dependents: Keypad_input_OS2 Keypad_input
see /users/kenjiArai/notebook/keypadkey-matrix--control/
Revision 2:a3545b56bdd7, committed 2017-12-21
- Comitter:
- kenjiArai
- Date:
- Thu Dec 21 22:46:19 2017 +0000
- Parent:
- 1:ed0ad90ad734
- Child:
- 3:0ea41738b560
- Commit message:
- bug / buffer size -> initialize different size
Changed in this revision
Keypad.cpp | Show annotated file Show diff for this revision Revisions of this file |
Keypad.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/Keypad.cpp Sat Sep 30 23:26:44 2017 +0000 +++ b/Keypad.cpp Thu Dec 21 22:46:19 2017 +0000 @@ -6,7 +6,7 @@ * http://www.page.sannet.ne.jp/kenjia/index.html * http://mbed.org/users/kenjiArai/ * Created: September 27th, 2017 - * Revised: October 1st, 2017 + * Revised: December 22nd, 2017 */ #include "Keypad.h" @@ -36,7 +36,7 @@ key_state[j][i] = Off_state; } } - for(i = 0; i < 32; i++){ + for(i = 0; i < BF_SIZE; i++){ buf[i] = 0; } read_addr = 0;
--- a/Keypad.h Sat Sep 30 23:26:44 2017 +0000 +++ b/Keypad.h Thu Dec 21 22:46:19 2017 +0000 @@ -6,7 +6,7 @@ * http://www.page.sannet.ne.jp/kenjia/index.html * http://mbed.org/users/kenjiArai/ * Created: September 27th, 2017 - * Revised: October 1st, 2017 + * Revised: December 22nd, 2017 */ #ifndef KEYPAD_H @@ -21,7 +21,7 @@ * #include "mbed.h" * #include "Keypad.h" * - * // every 2ms runs 6uS for key detection (CPU occupancy is 0.3%) + * // every 2ms runs 6uS for key detection(CPU occupancy is 0.3%/Nucleo-F446RE) * // output port X Y Z * // Input A * 0 # * // Input B 7 8 9