Re: Can't get com port programs to work
I got the two computers to communicate using serial.e, but all I get on the
output (comin.ex) is 30's and 31's. I send the ascii code of the key I
press (using comout.ex), but always get a 30 or 31 (and maybe a 28) on the
other computer. I've included the modified files.
Thanks again,
Ben
-----------------COMOUT.EX---------------------
--Accept input from keyboard and send it to com1
include get.e
include serial.e
integer key
while 1 do
key = wait_key() --Get input from the keyboard
if key = 27 then --If it's ESC, then exit
exit
else
SendSerialByte(1,key)
end if
end while
puts(1,"All done!\n")
--------------------------------------------
-----------------COMIN.EX-------------------
--Accept input from com1, and send it to display
include serial.e
integer data,key
while 1 do
key = get_key()
if key > 0 then
exit
end if
data = GetSerialByte(1)
if data > 0 then
printf(1,"%d",{data})
end if
end while
puts(1,"\nAll done!\n")
-------------------------------------------
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
|
Not Categorized, Please Help
|
|