Copyright © Parallax Inc.
Gimbal Joystick with Adapter (#27808)
v1.2 11/13/2019 Page 8 of 9
Next, enter the following demo program into the BASIC Stamp Editor software. (Or, download 27808-
Gimbal-Joystick-Debug.bs2 from the
, search “27808”). The BASIC Stamp Editor
software is a free download from
http://www.parallax.com/basicstampsoftware
):
' {$STAMP BS2}
' {$PBASIC 2.5}
LR VAR Word
UD VAR Word
DO
HIGH 4
PAUSE 10
RCTIME 4, 1, UD
HIGH 11
PAUSE 10
RCTIME 11, 1, LR
DEBUG HOME, "Vert: ", DEC UD, CLREOL, CR,
"Horiz: ", DEC LR, CLREOL
PAUSE 50
LOOP
Press the
F9
key to load and run the program. You should see output that looks like this:
As you move the joystick around, the numbers will change with the positions of the horizontal and
vertical axes. These values may be used as-is, or scaled to appropriate input values for the device you
would like to control with the joystick.