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.

tep 1<br />

The input port and output port described previously will be used<br />

this experiment. By now, you should be familiar with these types<br />

ports, but we refer you to Experiment Nos. 2, 3, and 8 for the<br />

cessary details. If you have not performed these experiments, we<br />

ommend that you do so before going on with this experiment.<br />

In this experiment, you will use the computer to acquire and disay<br />

a set of values that are acquired from the input port. While<br />

ese may be acquired with software steps such as:<br />

INPUT A$<br />

Q = PEEK(49319)<br />

INPUT A$<br />

R = PEEK(49319)<br />

·stakes a great number of software steps to acquire a small amount<br />

information. Can you suggest an alternative<br />

ist of values can be acquired by using a loop, and an array can<br />

used to store the information, so that a new variable need not<br />

assigned to each new data value. Can you write a short program<br />

t could be used to acquire 10 data points<br />

used the following program, which should look somewhat like<br />

s. Note the use of an array to store the information.<br />

0<br />

DIM A(lO)<br />

PRINT "START"<br />

FOR P = 1 TO 10<br />

INPUT A$<br />

A(P) = PEEK(49319)<br />

NEXT P<br />

PRINT "START DISPLAY • • ."<br />

123

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

Saved successfully!

Ooh no, something went wrong!