Re: Can't get com port programs to work
- Posted by JJProg at CYBERBURY.NET Jan 25, 2000
- 423 views
EU>I got the two computers to communicate using serial.e, but all I get on the EU>output (comin.ex) is 30's and 31's. I send the ascii code of the key I EU>press (using comout.ex), but always get a 30 or 31 (and maybe a 28) on the EU>other computer. I've included the modified files. EU>Thanks again, EU>Ben EU>-----------------COMOUT.EX--------------------- EU>--Accept input from keyboard and send it to com1 EU>include get.e EU>include serial.e EU>integer key EU>while 1 do EU> key = wait_key() --Get input from the keyboard EU> if key = 27 then --If it's ESC, then exit EU> exit EU> else EU> SendSerialByte(1,key) EU> end if EU>end while EU>puts(1,"All done!\n") EU>-------------------------------------------- EU>-----------------COMIN.EX------------------- EU>--Accept input from com1, and send it to display EU>include serial.e EU>integer data,key EU>while 1 do EU> key = get_key() EU> if key > 0 then EU> exit EU> end if EU> data = GetSerialByte(1) EU> if data > 0 then EU> printf(1,"%d",{data}) EU> end if EU>end while EU>puts(1,"\nAll done!\n") EU>------------------------------------------- EU>______________________________________________________ EU>Get Your Private, Free Email at http://www.hotmail.com First, make sure both computers are using the same baud, parity, data, and stop bits using GetPortBPDS and SetPortBPDS. Also, check that you have the right kind of cable - some switch the wires around, and others don't. Jeff JJProg at cyberbury.net http://members.tripod.com/~JJProg/