Keypad decode
Archiver
Posts: 46,084
Hi All,
Can anyone help with decoding a 4x4 matrix keypad. I am using an
EDE1144 IC.
The following codes seems to work excetpt for the * and # keys. What
numerical value shuold be returned for these two keys? Is it 8 and 13
or 35 and 42, or something else?
I would like to goto subroutines when * and # are pressed. i,e. Reset
and Toggle relay.
I have used a sample of code that I found. As such, I don't
understand the statements value=value-42 and value=value-7.
I have had to remap the keys to suit.
If you can help it would be appreciated.
Thanks
value=value -48
'debug value,cr
if value<10 then keyscan
value=value -7
debug value,cr
Keyscan:
LOOKUP value, [noparse][[/noparse]42,55,56,57,52,53,54,49,50,51,65,66,67,68,35,42],result
if value=35 then reset
if value=42 then tgl
Ken
Can anyone help with decoding a 4x4 matrix keypad. I am using an
EDE1144 IC.
The following codes seems to work excetpt for the * and # keys. What
numerical value shuold be returned for these two keys? Is it 8 and 13
or 35 and 42, or something else?
I would like to goto subroutines when * and # are pressed. i,e. Reset
and Toggle relay.
I have used a sample of code that I found. As such, I don't
understand the statements value=value-42 and value=value-7.
I have had to remap the keys to suit.
If you can help it would be appreciated.
Thanks
value=value -48
'debug value,cr
if value<10 then keyscan
value=value -7
debug value,cr
Keyscan:
LOOKUP value, [noparse][[/noparse]42,55,56,57,52,53,54,49,50,51,65,66,67,68,35,42],result
if value=35 then reset
if value=42 then tgl
Ken
Comments
>Hi All,
>
>Can anyone help with decoding a 4x4 matrix keypad. I am using an
>EDE1144 IC.
>
>The following codes seems to work excetpt for the * and # keys. What
>numerical value shuold be returned for these two keys? Is it 8 and 13
>or 35 and 42, or something else?
Hello Ken,
To clarify the outputs of the EDE1144 as listed on page 3 of the datasheet
at www.elabinc.com ,the outputs are ASCII values designed to print the
characters 0-9, then A-F (hex characters) as outputs for the sixteen
keys. This is done so that operation can be easily verified with a
terminal program, etc.
The program you mentioned first removes the ASCII offset for the
keys. Note that in ASCII there is a gap between '9' and 'A', so the amount
subtracted needs to be different once you have reached the tenth key when
converting the outputs to a standard decimal 0-15 value.
-Todd Peterson
E-Lab Digital Engineering, Inc.
www.elabinc.com (816) 257-9954