Dec 152017
 
Joystick testing program. Includes complete Basic source code.
File JOYSTK.ZIP from The Programmer’s Corner in
Category BASIC Language
Joystick testing program. Includes complete Basic source code.
File Name File Size Zip Size Zip Type
JOYSTICK.BAS 5653 1766 deflated
JOYSTICK.DOC 6061 2303 deflated
JOYSTICK.EXE 45851 31796 deflated
TPCREAD.ME 199 165 deflated

Download File JOYSTK.ZIP Here

Contents of the JOYSTICK.DOC file


+----------------------------------------------------------------------+
| JOYSTICK |
| Version 4.1 4/23/1988 Steven Rich |
| 24162 Gleneyrie |
| Southfield, Mi. 48034 |
| |
| Released to the Public Domain for Non-Profit, Non-Commercial |
| Use ONLY. |
|----------------------------------------------------------------------+

REVISION HISTORY
Version 4.1 - 04/23/1988 -Couldn't leave well enough alone.
1) Recompiled using QuickBasic 4.0 (and I thought 2.0 was
good!)
2) Added MAX, MIN, and AVERAGE for X & Y Axis.
3) Cleaned up problem when buttons were tested (messed up
screen).
4) Mild graphics added to display.

Version 3.1 - 01/11/1987 -First Version released to Public Domain
-----------------------------------------------------------------------------

Being very picky about all my computer equipment, I saw a need for a
program that would quickly test out the operation of a joystick, and make the
calibration of the trim pots easier. I came up with JOYSTICK.

Operation of the program is straightforward. An opening screen is shown
and you are asked which joystick port (1 or 2) you are hooked up to.
Answering that, the program begins.

NOTE: The only way to change the port is to exit (with -)
and start again. If you have two joysticks, run the program for one
port, then exit, then select the second port and run it again.

Seven areas of information are presented:

JOYSTICK UNDER TEST - At the top center. Shows 1 or 2 depending on which
port you have chosen to test.

JOYSTICK TREND - Shows with arrows the apparent direction the Joystick
is being moved in. If no motion is detected, a "0"
appears in the center of the arrows. Look for relative
smoothness of operation. This test revealed a bad
potentiometer in my first joystick.

BUTTON 1 - Flashes whenever the first (usually RED) trigger is
pressed. This is usually the button found at the top
of more expensive joysticks. The final color of the
display has NO significance at all.

BUTTON 2 - Flashes whenever the second (usually BLACK) trigger is
pressed. The final color of the display has NO
significance at all.

Note that some slightly erratic behavior may be noticed
in the flashing of the button displays. This is
because I was forced to STOP the execution of the
button "Interrupts" while doing screen writes. The
behavior is the result of wanting a clean display and
does NOT mean the buttons are bad. Try not touching
the joystick when you test the buttons for a fairly
accurate display.

ABSOLUTE VALUE - Probably the most useful display. Shows the numeric
value that Basic is receiving for the current joystick
position.

MAX, MIN, AVG - Shows the Maximum, Minimum, and Average (Mean) values
for the X & Y potentiometers. this information is
necessary to accurately adjust the joystick.

Most joysticks require initial calibration of trim. When the values
displayed obtained when joystick is CENTERED are ** BOTH ** EXACTLY one HALF
those shown when the joystick is moved to the LOWER RIGHT position, the
joystick is properly trimmed.

EXAMPLE:

1) Rotate the Joystick to every possible location you can (i.e make a
big clockwise circle covering all points). The program will note
the maximum and minimum positions for both the X & Y axis. The
Average of the max and min along each axis is also computed.

2) Let go of the joystick. The ABSOLUTE VALUE display should show
values close to the respective X & Y AVERAGE display.

ABSOLUTE VALUE

X-Axis 120 125 Y-Axis
MIN MAX AVG ^ ^ AVG MIN MAX
0 246 123 <--| |--> 130 10 250

The absolute value is unimportant. The fact that it is equal to the
Average is what counts.

Adjust the potentiometers, if accessable, per the maunfacturers
recommendations, so that the ABSOLUTE VALUE and X & Y AVERAGES Match.

----------------
PROGRAMMING NOTE

This program is written in QuickBasic V4.0. The .ARC file should
contain this documentation, a standalone .EXE file compiled with BCOM40.LIB,
and the source code.

I have included the source code for several reasons. First, this is
for the Public Domain, so I feel including source code is ESSENTIAL. Second,
if you have QB V4.0, you can create a 'Standard' version which uses BRUN to
conserve space in your system. Third, if this can form the basis of someone
elses program, so be it. Fourth, if you want to make changes, have fun.
Forth, there is no better insurance against "Viruses" than to recompile
source code.

This program was no big deal, but it has shown me some of the power
(and speed) of QuickBasic. I think it is an excellent tool.


Steven Rich








 December 15, 2017  Add comments

Leave a Reply