Download Print this page

Atari CX70 Operator's Manual page 42

Light pen

Advertisement

ATARI Light Pen Operator's Manual
A
BC
D
E
FG
H
I
JKLMN
0PQR5 TU
UMKYZ
.
,
;
;
!
'!> [ ] $
b r
THIS
IS
P
TEST
OE
THE
LIGHT
PEN
TOUCH
OND
TYPE
PROGROM.
Figure 15
Television Screen Display for Programming Example 3
The program begins by allocating space for the character string and
presetting the left margin to zero. At line 20f the screen color and
letter color are set. Line 30 defines the start of PENBUF»
sets the
number of position reads for which a median is to be calculated' and
loads PENBUF into memory.
The letter menu is printed on the screen by lines 40 and 50. Then the
program waits in a loop at line 60 until the pen switch is pressed. As
with the previous demosi line 70 uses PENBUF to interpret the pen
location. Because this is Graphics 0>
the X and Y locations are found
from locations 208 and 209.
Since only the first three rows (numbers 0>
1« 2) actually contain the
characters* the program ignores any pen location in a row greater than
2.
If the row number is valid*
it transforms the row and column data
in a positional subscript into the char^acter string. The character is
then printed on the screen.
If the character was either the backspace or return* the function
selected is performed. In any case* the computer will loop back to
line 60 again* waiting for a further light pen input.
A Keyboard Sustitute - 38

Advertisement

loading