The place values in a binary number are powers of two. Figure
6-2
shows how you use a decimal sum—74—to fire a particular pattern. If
you try adding several numbers together, you’ll see that with this sys-
tem you get no duplicates. The number
6
represents elements
2
and
4
(since 2 +
4
= 6) and there is no other way to get
6
by adding powers
of two. This means that any combination of the eight elements adds
up to a unique decimal number that falls within the range 0 to 255.
With this labelling system, you fire the top element by sending
LPRINT CHR$(128). To fire the bottom graphics element, you send
LPRINT CHR$(1). If you want to fire only the top and bottom ele-
ments, you simply add 128 and 1, then send LPRINT CHR$(129). By
adding the appropriate label numbers together, you can fire any com-
bination of elements you want.
Note: If your computer system cannot send ASCII codes above 127,
you will not be able to fire the top element.
A Graphics Program
Now that we have discussed how Dot Graphics works,
the
follow-
ing program gives you an example of
what
you can do. This program
creates a series of space invaders. Type
the
program in exactly as you
see it.
10 WIDTH LPRINT
255
20 INPUT "GRAPHICS CODE (K, L)";CODE$
30
INPUT "n1 and n2 PLEASE";N1,N2
40
INPUT "HOW MANY GRAPHICS DATA";DCOUNT
50
DIM D(DCOUNT)
60
FOR J=1 TO DCOUNT
70 INPUT "DATA";D(J)
80
NEXT J
90 LPRINT CHR$(27);CODE$;CHR$(N1);CHR$(N2);
100 FOR L=1 TO (N1+N2*256)/DCOUNT
110 FOR K=1 TO DCOUNT
120 LPRINT CHR$(D(K));
1 3 0 N E X T K
140
NEXT L
150
END
When you RUN
the
program, it will first ask you to enter the con-
trol code that you want to use for dot graphics. Your choices are
<ESC> K or <ESC> L. Enter
K
to run the program in Single-Density.
4 5
Содержание P-80
Страница 1: ...EPSON P 80 PORTABLE PRINTER User s Manual ...
Страница 11: ...Figure 1 1 Unpacking the P 80 Top view Figure 1 2 Identifying the printer parts 4 ...
Страница 15: ...Figure 1 6 Installing the ribbon 8 ...
Страница 49: ...Figure 6 1 Labelling elements Decimal sum of the desired pin pattern Figure 6 2 Element combinations 4 4 ...
Страница 59: ...Special Characters A 4 ...
Страница 72: ...Interface Signals E 4 ...
Страница 79: ......