LK204 Not returning key release? (i2c mode, polling)

LK/ELK/VK/PK/OK/MX/GLK/EGLK/GVK/GLT Series

Moderators: Henry, Mods

Post Reply
K_Trenholm_GDC
LCD?
Posts: 7
Joined: Thu Jun 12, 2014 1:11 pm

LK204 Not returning key release? (i2c mode, polling)

Post by K_Trenholm_GDC »

Hi all,

I started a thread last week regarding the keypad returning keypresses. The problem ended up being solved, I was not configuring correctly (protocol was not set to I2C in software). I'm now trying to program some simple key press/release code for repeating events upon holding a key.
I am configuring the LK204 keypad for the following:
-Auto-Transmit OFF (0xFE, 0x4F)
-Auto-Repeat OFF (0xFE, 0x60)

The issue seems to be that the LK204 is not putting the key release byte into the buffer. I am receiving the keypress properly (in this case, a press of the center key, 'E' or 0x45 hex. From what I understand, when the key is released, 'e' (0x65 hex) should be placed in the buffer for me to read on my next poll of the keypad buffer.

I release the key, and I read the buffer again. I continue to get 0x00 from the LK204. No sign of the release keycode. The MSb is 0, so the buffer appears to not have anything else in it. Am I misunderstanding how this process works? Is there something I am missing? Thanks in advance for any help. Let me know if you require any more information.

Tino
Matrix Orbital
Matrix Orbital
Posts: 158
Joined: Wed May 22, 2013 9:04 am
Location: Matrix Orbital

Re: LK204 Not returning key release? (i2c mode, polling)

Post by Tino »

Hi,

Did you try changing the Auto Repeat Mode?
If you keep Auto Repeat Mode on and set to Typematic you should receive the Up and Down values of each key when pressed and released.

Thank you,
Martino
Martino DeLeon
Matrix Orbital
Technical Support Representative

K_Trenholm_GDC
LCD?
Posts: 7
Joined: Thu Jun 12, 2014 1:11 pm

Re: LK204 Not returning key release? (i2c mode, polling)

Post by K_Trenholm_GDC »

Thanks for the response.

I actually figured it out a couple hours ago but didn't update the post yet.

Using the "Set Auto Repeat" command rather than the "Auto Repeat Mode Off" command worked.

0xFE /*Command*/
0x7E /*Set Auto Repeat*/
0x01 /*Off*/

So now I guess the followup question would be does the "Auto Repeat Mode Off" command not do what I think it does?

Tino
Matrix Orbital
Matrix Orbital
Posts: 158
Joined: Wed May 22, 2013 9:04 am
Location: Matrix Orbital

Re: LK204 Not returning key release? (i2c mode, polling)

Post by Tino »

Hi

The "Auto Repeat Mode Off" command turns the Auto Repeat off.
By Default it is set to On.

When you set the Auto Repeat Mode you also turn the Auto Repeat Mode to on.

If you have any other questions please feel free to ask.
Again thank you for posting.
Martino
Martino DeLeon
Matrix Orbital
Technical Support Representative

K_Trenholm_GDC
LCD?
Posts: 7
Joined: Thu Jun 12, 2014 1:11 pm

Re: LK204 Not returning key release? (i2c mode, polling)

Post by K_Trenholm_GDC »

Right, so

0xFE /*Command*/
0x7E /*Set Auto Repeat*/
0x01 /*Off*/

should have the same effect as:

0xFE /*Command*/
0x60 /*Auto Repeat Off*/

Correct?
What's bothering me is that the behavior I'm seeing is that the top command works, and turns the auto repeat off, but the bottom command does not (I don't see the key release code).

Tino
Matrix Orbital
Matrix Orbital
Posts: 158
Joined: Wed May 22, 2013 9:04 am
Location: Matrix Orbital

Re: LK204 Not returning key release? (i2c mode, polling)

Post by Tino »

Hi,

The command:


0xFE /*Command*/
0x7E /*Set Auto Repeat*/
0x01 /*Off*/

Sending 0x01 does not set the Auto Repeat to off it sets the Auto Repeat Mode to "Typematic" mode. Which will send the Up and Down key values.
This is a error in the manual which I have forwarded on to have it fixed. Thank you for bringing this to our attention.

Sending the "Auto Repeat Off" well set the display to only return the Down value of a key press.

To return both values as you would like to do then you would need to set the Display to Typematic mode as you did sending :

0xFE /*Command*/
0x7E /*Set Auto Repeat*/
0x01 /*Off*/

Thank you again for posting on our forums and also bringing the error to our attention.
Martino
Martino DeLeon
Matrix Orbital
Technical Support Representative

K_Trenholm_GDC
LCD?
Posts: 7
Joined: Thu Jun 12, 2014 1:11 pm

Re: LK204 Not returning key release? (i2c mode, polling)

Post by K_Trenholm_GDC »

Okay now it's making sense.

I did think it odd that the "1" command was turning it "off".

Thanks for the clarification.

Tino
Matrix Orbital
Matrix Orbital
Posts: 158
Joined: Wed May 22, 2013 9:04 am
Location: Matrix Orbital

Re: LK204 Not returning key release? (i2c mode, polling)

Post by Tino »

Hi,

You are very welcome.
Thanks again for bringing this to our attention.

Martino
Martino DeLeon
Matrix Orbital
Technical Support Representative

Post Reply