Keypad input problem. Worked before but not now....
Posted: Fri Aug 08, 2003 9:57 pm
Hello. I just got my LK 204-25 serial display in the mail today
. I sat down and wrote a few functions to clear the screen, turn off the cursor, turn on the cursor, etc. No problems. I then wrote a fuction to read input from my 4x4 keypad and print out the result on my computer screen. Again no problems.
The program that I wrote to test the 4x4 keypad worked fine at first. I shut down my computer and came back to it later to do some more coding. The same program to display keypad presses on my computer screen no longer worked. Instead of being displayed on the computer screen they are now displayed on the lcd.
Letters like A, B, C, etc.
What the hell happend. I have tried to figure this out. I can't. It's been hours. I am running mandrake linux 9.1. Here is what the function to read keypad out to the computer screen looks like. Note: this used to work like I intended.
void read_and_dis_input(void)
{
read(fd, &input, 1);
printf("Here is my input ---> %u\n", input)
}
Here is what fd is: fd = open( device, O_RDWR | O_NOCTTY );
input is: int input;
Like I said this used to print out values like 75, 74, 54, etc.. to my computer display. Now it prints letters to my lcd screen. This makes no sense I didn't recompile, or change my code. Henry, if your out there please take a look at this. I would greatly appreciate someones help here.



What the hell happend. I have tried to figure this out. I can't. It's been hours. I am running mandrake linux 9.1. Here is what the function to read keypad out to the computer screen looks like. Note: this used to work like I intended.
void read_and_dis_input(void)
{
read(fd, &input, 1);
printf("Here is my input ---> %u\n", input)
}
Here is what fd is: fd = open( device, O_RDWR | O_NOCTTY );
input is: int input;
Like I said this used to print out values like 75, 74, 54, etc.. to my computer display. Now it prints letters to my lcd screen. This makes no sense I didn't recompile, or change my code. Henry, if your out there please take a look at this. I would greatly appreciate someones help here.