Page 1 of 1

Posted: Mon Apr 01, 2002 8:43 am
by WilburNutsack
Hi
Has anyone got a function or could be bribed to write me one which checks com1 for any characters? I have wired up my keypad and checked it with hyper terminal. I also made a function with LabWindows CVI to determine the ASCII values, but i cant get it to work in Borland, so i am now back to square one.

I have a constant loop which check if there is a character waiting, if there is, i have a function to deal with it, then it continues decoding, if there is not, it just continues decoding the MP3.

e.g.
while (1)
{
var = checkSerial();// function needed
if (var != 0)
{
var == 1 do this...
var == 2 do other...
just handle input if there is any
}
if (Playing == 1)
{do {
status = decoder_play(decoder);
} while (status == XA_SUCCESS);
}
DisplayMenu();
DisplayCursor();
}

Any help would be greatly appreciated.
Feel free to contact me directly if you think you can help.
jiggyjiggylefteye@hotmail.com

Thanks

Posted: Tue Apr 02, 2002 10:03 am
by Mat-Moo
Find a proper COM component to handle this, then it will raise an event when it recieves a character via RX

Posted: Tue Apr 02, 2002 5:19 pm
by DJRobX
Or, you can try the Win32 serio libary from:

http://www.alumni.caltech.edu/~dank/serio/serio.zip

Might be a lot simpler than interfacing with COM. I know handling COM events is a serious pain in MFC, I'm not sure how easy or difficult it is with Borland.

Posted: Tue Apr 02, 2002 5:26 pm
by Henry