27.01.2015 Views

titus-larsen-titus-1981-apple-interfacing

titus-larsen-titus-1981-apple-interfacing

titus-larsen-titus-1981-apple-interfacing

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

80 FOR P = 1 TO 10<br />

90 GET A$<br />

100 PRINT A(P): POKE 49318,A(P)<br />

110 NEXT P<br />

120 PRINT "END OF RUN": END<br />

In this program, you must press the RETURN key to cause<br />

computer to acquire a value. When the computer prints "ST A<br />

DISPLAY ..." on the screen, it will display a value that it has sto<br />

each time you press RETURN. The value will also be displayed<br />

the LEDs in binary form. Note that a GET A$ command has<br />

used here, instead of an INPUT A$. Is there any difference<br />

Yes, the GET A$ command suppresses the question mark (), a<br />

any character key (A, &, 1, etc.) may be used in place of the R<br />

TURN key. The alphanumeric symbol is not displayed. This "cle<br />

up" the display of the data values.<br />

Ste§> 3<br />

Run either your program, or ours, to acquire 10 data values. On<br />

the values have been acquired, use the computer to display tn1rn,,F<br />

What results do you observe<br />

You should find that your values have been stored properly,<br />

that they are also displayed and printed on the video monitor. If<br />

do not require the values at the output port, could you modify<br />

program so that it only displays the values on the monitor<br />

Yes. Simply change line 100 to:<br />

100 PRINT A(P)<br />

and. remove line 90.<br />

Step 4<br />

The low-resolution graphics mode on the Apple could also<br />

used to display the values in graphical form. We suggest that<br />

attempt to use the HLIN command to draw a horizontal set of<br />

124

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!