Star Micronics SB-15 user manual Next Lprint

Models: SB-15

1 128
Download 128 pages 39.39 Kb
Page 114
Image 114

Figure 10-l.Starting with the most significant bit at the top, each pin oftheprintheadis 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 #l : WIDTH j/1,255

54)PRINT #l,CHR$(27) "K" CHR$(WID MOD 256) CHR$(INT(WID/256)) ;

60 FOR I = 0 TO WID-1

70PRINT //l,CHR$(2^INT((l+SIN(I*PI/32))*3.5+.5);

80 NEXT I

90LPRINT

180CLOSE #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 SD- 10/l 5’s graphics.

-.

--

-

-

-

-

-

-

106

Page 114
Image 114
Star Micronics SB-15 user manual Next Lprint