Epson LX-90 User Manual - Parallel 8620 PIC for LX-90 - Page 59

First Graphics Program, LPRINT CHR$27KCHR$40CHR$0, FOR X=1 TO, LPRINT CHR$74;: NEXT X

Page 59 highlights

Figure 8-2. Calculating numbers for pin patterns With this numbering system, any combination of the eight pins adds up to a decimal number between 0 and 255, and no numbers are duplicated. Now that you know the principles of Epson graphics, you're ready for two simple exercises, more densities, and then something more complex as a basis for writing your own programs. First Graphics Program Your first graphics exercise could be a program that prints a single column of dots, but it is difficult to see the pattern in a single column of dots, so your first graphics program prints the same pattern 40 times. The first line is the code for 40 columns of single-density graphics. As usual, the example is in BASIC, but you can adapt it to the programming language you prefer. NEW 10 LPRINT CHR$(27)"K"CHR$(40)CHR$(0); The second line is the data that is printed as pin patterns. Be sure that you type in the semicolons in both lines: 20 FOR X=1 TO 40: LPRINT CHR$(74);: NEXT X That's it. Run the program to see the result below. Although it is not as interesting as the examples at the beginning of this chapter, it does allow you to see exactly how the mode works. 57

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122

Figure 8-2. Calculating numbers
for
pin patterns
With this numbering system, any combination of the eight pins
adds up to a decimal number between 0 and 255, and no numbers are
duplicated.
Now that you know the principles of Epson graphics, you’re ready
for two simple exercises, more densities, and then something more
complex as a basis for writing your own programs.
First Graphics Program
Your first graphics exercise could be a program
that
prints a single
column of dots, but it is difficult to see the pattern in a single column of
dots, so your first graphics program prints the same pattern 40 times.
The first line is the code for 40 columns of single-density graphics.
As usual, the example is in BASIC, but you can adapt it to the pro-
gramming language you prefer.
NEW
10 LPRINT CHR$(27)"K"CHR$(40)CHR$(0);
The second line is the data that is printed as pin patterns. Be sure
that you type in the semicolons in both lines:
20 FOR X=1 TO
40:
LPRINT CHR$(74);: NEXT X
That’s it. Run the program to see the result below. Although it is not
as interesting as the examples at the beginning of this chapter, it does
allow you to see exactly how the mode works.
57