I have a VK204-25 and im writing a app under linux in c++.
I have a keypad attached (which works, i have tested it in other progs) but i cannot seem figure out how to get input using c++.
I have read the post that discusses it but had no luck in implamenting the methods that were discussed.
The settings i have are
Block Cursor Off
Auto Line Wrap Off
Auto Scroll Off
Auto transmit key Off
Auto repeat off
I am using write() to send commands/text to the lcd screen and this is all working fine.
This is what i have tried so far, lcd_command is a function which sends the command prefix and whatever command specified with the parameter, fdDisplay is what is returned when i do my open command
fdDisplay = open("/dev/ttyS0", O_RDWR | O_NOCTTY );
//Set up the timeout (only waits a sec)
tv.tv_sec = 1;
tv.tv_usec = 0;
FD_ZERO(&fd);
FD_SET( fdDisplay, &fd );
lcd_sendcommand(38); //Poll the keypad
retval = select(1, &fd, NULL, NULL, &tv);
//If we have something (which we never do) read it in
if(retval){
read(fdDisplay, &buf, 1);
cout << "Pressed : " << buf << "n";
}
Any help would be appriciated. Please feel free to comment on the state of my code and how i could improve it, i haven't done any c++ for a couple of years and am re-familierizing myself with it :-)
Thanks
Cip
Also, i cant spell! So please ignore any spelwing mistarkes :-p
<font size=-1>[ This Message was edited by: Chamma on 2002-09-27 18:38 ]</font>