AT&T 6300 Programmer's Manual page 466

Gwbasic by microsoft
Hide thumbs Also See for 6300:
Table of Contents

Advertisement

STICK
Function
Syntax
n
Remarks
Example:
7-310
Returns the x and y coordinates of two
joysticks.
v=STICK(n)
is a numeric expression in the range 0 to 3 which affects the
result as follows:
o
returns the x coordinate for joystick A.
1 returns the y coordinate of joystick A.
2 returns the x coordinate of joystick B.
3 returns the y coordinate of joystick B.
Note: STICK(O) retrieves all four values for the coordinates,
and returns the value for STICK(O). STICK(l), STICK(2),
and STICK(3) do not sample the joystick. They get the
values previously retrieved by STICK(O).
The range of values for x and y depends on
your particular joysticks.
10 PRINT uJoystick BU
20 PRINT uxu,UyU
30 FOR J=1 TO 100
40 TEMP = STICK(O)
50 X = STICK(2): V = STICK(3)
60 PRINT X,V
70 NEXT
This program takes 100 samples of the
coordinates of joystick B and prints them.

Advertisement

Table of Contents
loading

Table of Contents