[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lightweight joystick calibration program?



Toinet wrote:
On 12 mai, 20:22, dog_...@macgui.com (D Finnigan) wrote:

Steve Nickolas wrote:

On Thu, 12 May 2011, Jeff Shanholtz wrote:

If not, is the joystick easy to read in basic? Might be fun to dust
off my applesoft basic skills. :)

10 ? PDL(0),PDL(1):GOTO 10

One more point (sorry for making two followups):

Reading the paddles so close together will affect the reading, or so the
manuals say. Conventional wisdom of the day suggested a short FOR loop
(maybe about 10 iterations) in between each PDL() function.

--
]DF$
Mac GUI Vault - A source for retro Apple II and
Macintosh computing.http://macgui.com/vault/


David,
Any pointers please, I didn't know that. Thanks.

The problem arises when the first paddle read has a low value
and the second paddle has a high value.

The first timer times out while the second is still running,
and the second paddle read does not re-trigger the still running
second timer.

For purposes of calibration, where the mid-scale value is the
only relevant reading, there is never any problem, since both
timers will time out essentially simultaneously at the 127,127
reading.

The maximum difference in timeouts (with a standard joystick)
is 255 counts, or about 3 milliseconds, worst case.  To get the
worst case delay required, one would need to subtract the time
for Applesoft to get from the first PDL() to the second PDL(),
which is probably about one millisecond.

So, worst case, a two millisecond delay would be needed to prevent
any possibility of interaction.

If, in a program, the paddles are read in different lines, then
it is likely that much of the needed delay is already present.

This interaction can be exhibited with the short paddle "calibration"
routine above, but in actual programs, it is unusual for the
interaction to occur.

Others,
I would have said: add a line or two to allow keyboard interruption
(i.e. CTRL-C)

My (copyrighted) program is:
10 PRINT PDL(0),PDL(1)
20 REM
30 GOTO 10

No need--even a single-line loop can be ctl-C'd.

-michael

NadaNet 3.1 for Apple II parallel computing!
Home page:  http://home.comcast.net/~mjmahon/

"The wastebasket is our most important design
tool--and it's seriously underused."