Star Micronics SG-10 User Manual page 114

Star micronics printer user's manual
Table of Contents

Advertisement

0 1
U
0
(not used)
Figure 10-l.
Starting
with the most significant
bit at the top, each pin
of the print head is assigned a value which is a power of two. Note that
for 7-bit computers,
the top pin cannot be used.
-
-
A short program
should demonstrate
how to implement
the
graphics command.
The program below gave us this printout:
10 'Demo dot graphics.
20
PI = 3.14159
30 WID = 100
40 OPEN "LPTl:"' AS f/l : WIDTH #1,255
50 PRINT #l,CHR$(27) "K" CHR$(WID MOD 256)
CHR$ (INT (WID/256) ) ;
60 FOR I = 0 TO WID-1
70 PRINT #l,CHR$(2"INT((l+SIN(I"pI/32))>k3.5+.5) ;
80
NEXT I
90 LPRINT
100 CLOSE #l
In line 50 we've selected normal density graphics and said that
100 characters of graphics data would follow. The loop between
line 60 and 80 is repeated to plot 100 points along a curve. This
is an example of plotting
a very simple mathematical
function
(a sine wave) to create a design. Later in this chapter we'll show
something
more complex. The mathematical
concepts (such as
sine and pi) demonstrated
here are not important;
you don't have
to be a math whiz to use SC-lo/l 5's graphics.
-.
-
-
106

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sg-15

Table of Contents