LK202-25 LCDd keypad test mode
-
- LCD?
- Posts: 6
- Joined: Wed May 14, 2008 11:24 am
LK202-25 LCDd keypad test mode
Hi,
Trying to get the above device to work in linux and when i run LCDd in keypad test mode I receive the following:
MtxOrb: Received character
Trying to get the above device to work in linux and when i run LCDd in keypad test mode I receive the following:
MtxOrb: Received character
-
- Matrix Orbital
- Posts: 745
- Joined: Thu Dec 13, 2001 4:00 pm
- Location: Earth.... I think..
- Contact:
Not quite sure there is a question in your post but I gave it a try to reproduce what you are getting anyway.
When you enable the keypad test mode it will spit back messages such as
Are you getting different results?
When you enable the keypad test mode it will spit back messages such as
Code: Select all
MtxOrb: Received character A
MtxOrb: Press another key of your device
MtxOrb: Received character E
MtxOrb: Press another key of your device
MtxOrb: Received character D
MtxOrb: Press another key of your device
-
- LCD?
- Posts: 6
- Joined: Wed May 14, 2008 11:24 am
?
it would appear i'm having truble
Code: Select all
MtxOrb: Received character
Last edited by tom.garratt on Wed May 14, 2008 2:22 pm, edited 1 time in total.
-
- LCD?
- Posts: 6
- Joined: Wed May 14, 2008 11:24 am
In deed. I've posted the output at http://pastebin.com/m900d40Ray wrote:I see you are struggling to get your complete post on, the forum seems to dislike any unicode character you have in your post and cuts off at the character it dislikes, just remove the character and you'll be fine.
Hi Tom,
I am going to assume here that you have PCB Rev 3.0 for the LK202-25.
It looks like the keypad values are all jumbled up.
Please try sending this command:
254 / 213 / 255 / <49 more of 255> ...
Use 50 x 255's.
This command assigns the values of the keypad keys; putting 255 as parameters makes the LK202-25 do a default 'A', 'B', 'C', 'D' .. values.
Best Regards,
I am going to assume here that you have PCB Rev 3.0 for the LK202-25.
It looks like the keypad values are all jumbled up.
Please try sending this command:
254 / 213 / 255 / <49 more of 255> ...
Use 50 x 255's.
This command assigns the values of the keypad keys; putting 255 as parameters makes the LK202-25 do a default 'A', 'B', 'C', 'D' .. values.
Best Regards,
Raquel Malinis
Design and Development
Matrix Orbital
Design and Development
Matrix Orbital
-
- LCD?
- Posts: 6
- Joined: Wed May 14, 2008 11:24 am
how
and how do i send those command. I assume I can not simply use LCDd and echo the command to the display using pearl?
-
- Matrix Orbital
- Posts: 745
- Joined: Thu Dec 13, 2001 4:00 pm
- Location: Earth.... I think..
- Contact:
If you have no means of sending that on your own, easiest thing to do is probably take the hello world application from our linux app note and replace the welcome message with
Code: Select all
unsigned char WelcomeMessage[] =
{254,213,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255};
-
- LCD?
- Posts: 6
- Joined: Wed May 14, 2008 11:24 am
Worked like a treat. now only if I could find a "hello world" example of reading key pressess in c++Ray wrote:If you have no means of sending that on your own, easiest thing to do is probably take the hello world application from our linux app note and replace the welcome message with
Code: Select all
unsigned char WelcomeMessage[] = {254,213,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255};
-
- Matrix Orbital
- Posts: 745
- Joined: Thu Dec 13, 2001 4:00 pm
- Location: Earth.... I think..
- Contact:
Thats not much more difficult, add this snippet of code after sending the welcome message
Code: Select all
unsigned char input;
while (true)
{
read(lcd,&input,1);
printf("You pressed %c\n",input);
}
-
- LCD?
- Posts: 6
- Joined: Wed May 14, 2008 11:24 am
Thanks
Thanks you guys, you all have been most helpful. I have one question.....Ray wrote:Thats not much more difficult, add this snippet of code after sending the welcome message
Code: Select all
unsigned char input; while (true) { read(lcd,&input,1); printf("You pressed %c\n",input); }
if i use something like :
Code: Select all
unsigned char input;
unsigned char clearkey[] = {254,69};
while (true)
{
read(lcd,&input,1);
//printf("You pressed %c\n",input);
if (input =='L')
{
printf("Connection Status");
write(lcd,clearkey,sizeof(clearkey));
printf("You pressed %c\n",input);
}
}
-
- Matrix Orbital
- Posts: 745
- Joined: Thu Dec 13, 2001 4:00 pm
- Location: Earth.... I think..
- Contact:
My bad, the sample program opens the serial port in non blocked mode, so the read call will not block until you press a key but return immediately even when there's no data available.
So depending a bit on what you want you can either remove the O_NONBLOCK from the opening flags to make the read block until you press a key.
Or don't remove the flag and check the return value of the read function like this
however do realize it will run the code in your while loop an insane ammount of times so you probably want to put a delay in there so it won't soak up 100% cpu time while waiting for a keypress.
Also there is no need to clear the key unless you are in polled mode which is not the case by default.
So depending a bit on what you want you can either remove the O_NONBLOCK from the opening flags to make the read block until you press a key.
Or don't remove the flag and check the return value of the read function like this
Code: Select all
unsigned char input;
while (true)
{
if (read(lcd,&input,1)==1)
{
if (input =='L')
{
printf("Connection Status");
printf("You pressed %c\n",input);
}
}
}
Also there is no need to clear the key unless you are in polled mode which is not the case by default.