I have 2 PCs and a cable to connect PCs through the serial port. The cable works with the PCs(It worked with File and setings transfer wizard. I would like to use it with QBasic to send variables back and forth. How do I do this?
--------------
http://brandoncornell.com
Serial Port
-
- Veteran
- Posts: 399
- Joined: Wed Mar 02, 2005 9:01 pm
- Location: Nashville, Tennessee
- Contact:
Basically, you need to have a computer running a sending program, and the other running a recieving program.
Sending program (sends key strokes)
I *THINK*...
Recieving program
Also making another assumption here... (The NULL signal is 0?) If not, both lines that say A=0 needs to be changed to A=(nullsignal)
Also, shouldn't this be posted in QB Q&A?
Sending program (sends key strokes)
Code: Select all
'PQBC Serial Link Terminal
WHILE KEY$ <> CHR$(27) 'Terminates on ESC
KEY$ = ""
WHILE KEY$ = ""
KEY$=INKEY$
WEND
OUT(&037F,ASC(KEY$))
WEND
- the syntax is OUT(ComPortAddress, ValueToSend)
&037F is the normal COM1 address
Recieving program
Code: Select all
X=1:Y=1 'Used to display text with LOCATE
WHILE A <> 27
A=0
WHILE A = 0
A = INP(&037F)
WEND
LOCATE X,Y:PRINT CHR$(A)
X=X+1
IF X > 80 THEN:X=1:Y=Y+1
WEND
Also, shouldn't this be posted in QB Q&A?
- {Nathan}
- Veteran
- Posts: 1169
- Joined: Thu Aug 19, 2004 6:08 pm
- Location: The wetlands of central Ohio, USA
- Contact:
Patz, I skimmed through your code and noticed your comment on X & Y varibles, and how they were used in the LOCATE statement. For some odd reason, in LOCATE the parameters are Y then X, so they should be swapped to:
Heh...
(From the demented mind of a crazed 13 year old...)
0_0
Code: Select all
LOCATE Y, X
(From the demented mind of a crazed 13 year old...)
0_0
-
- Veteran
- Posts: 399
- Joined: Wed Mar 02, 2005 9:01 pm
- Location: Nashville, Tennessee
- Contact:
-
- Veteran
- Posts: 399
- Joined: Wed Mar 02, 2005 9:01 pm
- Location: Nashville, Tennessee
- Contact: