Download Print this page

Radio Shack TRS-80 PC-2 Owner's Manual page 18

Hide thumbs Also See for TRS-80 PC-2:

Advertisement

RINKEY$
Fetch Current Character from the RS-232C
RINKEY$
RINKEY$ is used to fetch a single character from the RS-
232C.
RINKEY$ interacts with the RS-232C in exactly
the same way as IN KEY$ interacts with the keyboard: if
a character is available, it is fetched as a single character
string; otherwise null (" ") is returned.
It is used with the same syntax as any other function
which returns a string. For example, Z$
=
RINKEY$ is
a valid use.
To pause run of a BASIC program until a carriage return
(CHR$ 13) is received from the RS-232C port, use a
command sequence similar to the following:
100 A$
=
RINKEY$
110 IF A$
< >
CHR$ 13 THEN 100
The following short BASIC program will further demon-
strate R INKEY$. It will check the RS-232C port twice a
second and if any character is present at the RS-232C
port, it will be displayed:
100 WAIT 32
110 A$
=
RINKEY$
120 IF A$
=" "
PRINT "NO CHARACTER":
GOTO 110
130 PRINT A$: GOTO 110
30
j
SETCOM
Set Communications Parameters
SETCOM baud, word length, parity, stop bits
baud is the baud rate and is 50, 100, 110, 200,
300,600, 1200, or 2400. On power-up, 300
baud is used.
word length is the word length or number of bits
used to transmit a word 5, 6, 7, or 8.
On
power-up, 8 is used.
parity is odd, even, or none. On power-up, none
is used.
stop bits is the number of stop bits per byte
and is either 1 or 2. On power-up, 1 is used.
The SETCOM command is used to set the RS-232C's
communications parameters -
baud rate, parity, word
length, and number of stop bits. SETCOM may be used
in either the RUN or the PRO mode.
Typing SETCOM
(ENTER)
resets the RS-232C to their
power-up status:
SETCOM Power-Up Status
300 Baud
8 Bit Words
No Parity
1 Stop Bit
This is the same as typing:
SETCOM 300,8, N, 1
31

Advertisement

loading