I have found a need to read an old PC joystick and generate some movement commands.
The joystick is the older type with a 15 pin DB (DA actually) connector. Mine makes 3) 20k to 80k pots and 4 switch contacts available at the connector
My purpose is to drive a CNC gantry using servo or stepper motors (STEP and DIRECTION signals, not pulse length on hobby servos). The basics of manipulating the readings would be the same for use with a game or hobby servos and this may be useful to others.
Thd PIC will output X and Y movements based on the distance from center on the joystick with a small null in the center to prevent creep.
I have been unable to find anyone working on this with a search, so I will make a go of it and solicit any suggestions.
Since my joystick has 3 pots (X, Y, and trim) and 4 switches that can be read , the goal is to
grab the analog and determine if the X and Y are above or below center and set a direction pin to 1 or 0. Then the magnitude of the signal from center (minus the dead zone) will determine the number of pulses generated. The trim pot will modify the number of pulses and act kind of like a speed control or limit to tune the movement of the device. The switches will be used to activate extra functions on the device.
Reading the A/D should be straight forward, but I mulling how to control 2 pulse streams and adjust them using a third. Current target is a 18F2331 or 18F4431 and I'm going to see if I can get the PWM outputs to do what I want.
So far this is preliminary, so I'm just fishing to see if there is any interest. If there is, I will post my progress.
Bo
Bookmarks