Description: |
| | A Hardware Object that reads an Atari style joystick and returns an URCP heading value. |
| | The following table lists the size and availability of the oJoyStick Object.
| | Object | Size | Description | A1 | A2 | B1 | B2 | C1 |
 | oJoyStick | 4 Bytes | Reads an Atari style joystick | x | x | x |
|
Operation: |
| | The oJoystick Object monitors a joystick which is expected to be an array of 4 switches. The 4 switches are arranged where one switch is pressed for any one of the 4 directions N, E, S, W that the joystick is pressed and two of the switches are pressed if the joystick is pressed in one of the 4 directions NE, SE, NW, SW. Joysticks made for the Atari game systems and computers provide this type of 4-bit value. A vintage Atari joystick is constructed in the way. When the joystick is pressed in any of the 8 possible directions, the Pressed property is set to 1, otherwise the Pressed property is cleared to 0. When created, the oJoystick Object also creates an instance of the oOrbitSwitch4 object which it uses to read the 4 I/O lines and generate the Heading value. Modifying any of the properties of the oOrbtSwitch4X Object instance will affect the oJoystick Object's operation. See the oOrbitSwitch4 for more detail on how the 4 I/O lines are read. |
Properties: |
| The following table lists the properties of the oJoyStick Object:
|
Examples: |
| | In the following example, the oJoystick Object is used.
'This program reads an Atari style
'joystick and outputs the URCP
'value to I/O lines 8 - 15.
Dim J As New oJoyStick
Dim D As New oDIO1(7,cvOutput)
Dim C As New oDIO8(3,cvOutput)
Sub Main()
ooPIC.PullUp = cvTrue
J.IOPack = 5
J.Operate = 1
Do
C = J.Heading
D = J.Pressed
Loop
End Sub |
|
Connections: |
|
| The joystick itself consisted of five switches which are arranged where four of them are used for the directions (UP, DOWN, LEFT, RIGHT) and one is for fire button. The joystick connector is a 9 pin D-shell connector. Normally all switches are open, when he joystick is pressed from the center position, one or two position switches are closed (according to what direction the stick is pressed). The fire button worked so that it closes when the button is pressed. All of the switches are connected between ground and corresponding signal pin of the joystick connector. 
|
 9 pin D-SUB female connector at the joystick
| Pin | Color | Description |
| 1 | WHT | Up |
| 2 | BLU | Down |
| 3 | GRN | Left |
| 4 | BRN | Right |
| 5 | n/c | Not connected |
| 6 | ORG | Button |
| 7 | n/c | Not connected |
| 8 | BLK | Ground(-) |
| 9 | n/c | Not connected |
|
|
Related Items:
|
| | The following table lists objects with related functions
| | Object | Description | A1 | A2 | B1 | B2 | C1 |
 | oBumper4 | Reads a 4-contact bumper. | x | x | x |
|
Version History and Bug List: |
| | Firmware Ver B1: Introduced. Bugs: No known bugs. |