home *** CD-ROM | disk | FTP | other *** search
GW-BASIC | 1983-03-03 | 1.0 KB | 17 lines |
- 100 'PC demo program to plot squiggle-var on NEC 8023 printer.
- 120 DEFINT I-N:DIM IT(1200),M(7):TUPI=6.28319:E$=CHR$(27)'(escape)
- 140 'Defeat automatic Cr/Lf's, set 1280 dots/line, 14/144 in. line feed.
- 160 WIDTH "LPT1:",255:LPRINT E$;"P";E$;"T07"; '(or T14, sometimes).
- 180 'Define trace plot mode - S/V, shade level 4 and down.
- 200 FOR I=1 TO 7:M(I)=2^(I-1):IF I>4 THEN M(I)=M(I)+M(I-1)
- 220 NEXT I
- 240 FOR JF=14 TO 33 'Plot 20 traces with JF dots/cycle.
- 260 'Compute 1 cycle of trace, amplitude range = 1 to 7.
- 280 FOR I=1 TO JF:J=(SIN(I*TUPI/JF)+1)*3+1:IT(I)=M(J):NEXT I
- 300 FOR I=JF+1 TO 1200:IT(I)=IT(I-JF):NEXT I 'Propagate sine-wave.
- 320 LPRINT E$;"S1200"; 'Set-up NEC to plot 1200 graphic samples.
- 360 FOR I=1 TO 1200:LPRINT CHR$(IT(I));:NEXT I 'Plot a trace.
- 380 LPRINT JF*10000:NEXT JF 'Make dummy SSP number and loop back.
- 400 'List the program in proportional mode, then reset printer back to normal.
- 420 LPRINT E$;"A":LLIST:LPRINT E$;"N":END
-