Download What is a micro-computer?

Transcript
and PAO w ill become a ' 1 The latch w ill stay in
this position until the port is poked w ith '4 ', when
PA1 w ill become '0 ' and reset the latch. The lat­
ching m echanism is required to prevent the in­
definite m ovem ents o f the pen from retriggering
the circuit. S e nsitivity can be adjusted by means
of the preset control.
Mechanical
The pen proper is an old opaque ball-point. It m ust
have an internal diam eter w h ich w ill allow the
light detector transistor to slide right to its end.
The photo-transistor looks like a transparent LED
and is the same size as the larger variety — 0 . 2 " .
The lead can be held w ith a small grom m et or
Araldite. I m ount m y 1 C and pot. on a small piece
of Vero, in the line itself.
Program
The flo w chart of the program is show n in diag. 2.
This should be easy to fo llo w when read in con­
ju n ctio n w ith the above description. Note th a t a
delay has to be introduced, even in the BASIC
program , to allow the screen persistence to fade.
There is, therefore, no point in trying to conve rt it
to m achine code as the tim e taken for the screen
to fade o u t w ill be the same and the program w ill
run no faster. A n y w a y , the tim e taken to scan 6
possible answers is quite short and acceptable.
'b lo b s '. Each succeeding option blob in the
menu is directly below the one above and 2
lines d o w n , hence the + 8 0 in line 401 4 0 (this
can be changed as required.).
Other points
The pen w ill w o rk w ell on any m onitor or external
T V attached to the com puter operating it.
The circu it sh o w n is easily adapted to other in­
puts and, w ith appropriate detectors, can be
made to s w itc h on a sound input, tem perature
change etc. Inputs are show n w h ich s w itc h either
on a '0 ' or '1 '.
The author is prepared to copy a dem onstration
program , w h ich includes full setting-up method,
flo w charts and in structions fo r those less
understanding o f com puters, onto your disk
( 3 0 4 0 ) or cassette (PET form at) or alternatively a
full printer listing, any fo r 5 0 p ( funds to ACC).
Please enclose return postage.
David Annal, 1 4 2 W inderm ere Road, London
S W 1 6 5HE.
-Z-.
Variables used are:
UP — User port address.
OP — Option num ber being tested (max 6 on our
menu)
PN — Position on screen o f firs t option blob — see
below .
DL — Delay loop.
DT — Num ber of tim es the pen has follow ed
correctly.
L I — 1 if light is detected by pen, 0 otherw ise.
For those not fam iliar w ith the PET, the fo llo w ­
ing notes should aid adaptation to your machine.
1. M em ory location 5 9 4 7 1 is the PET User Port
8-b it data bus.
2. Location 5 9 4 5 9 is the data direction register.
Poked w ith 2 5 4 , it sets all bits to outputs ex­
cept the firs t, PAO, w h ich w e are using as the
input from the pen.
3. Locations 3 2 7 6 8 - 3 3 7 6 7 are the screen
m em ory map ( 4 0 x 2 4 — 1 0 0 0 squares on PET
4 0 colum n). 3 3 1 2 3 is the firs t o f our menu
Commodore Computing