Interfacting Basic Stamp with Gameport/Joystick
DiablodeMorte
Posts: 238
Hiya everybody,
The subject line tells all: I'm trying to interface a gameport/joystick with a basic stamp. Before even looking up Gameports I got my Basic stamp reading a pot since I figured that what a joystick uses. After trying a similar approach with the gameport it seems I was mistaken. I took my joystick apart and it seems to not be controlled by pots in the normal sense. There are only 2 wires going to each "axis" which are mostly slides which I assume change resistance as the joystick is used/manipulated. How do I use this caputure this data? In the case of the throttle pot(which still only has 2 wires going to it) can I simply wire up the third post and use it as a normal pot?
Regards,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Current Projects:
Robot Control Via Skype API - Dev Stage(50% Complete) - Total(25%)
Robot Localization Via Xbee's - Research Stage
IR Tracking with Propeller - Research Stage
The subject line tells all: I'm trying to interface a gameport/joystick with a basic stamp. Before even looking up Gameports I got my Basic stamp reading a pot since I figured that what a joystick uses. After trying a similar approach with the gameport it seems I was mistaken. I took my joystick apart and it seems to not be controlled by pots in the normal sense. There are only 2 wires going to each "axis" which are mostly slides which I assume change resistance as the joystick is used/manipulated. How do I use this caputure this data? In the case of the throttle pot(which still only has 2 wires going to it) can I simply wire up the third post and use it as a normal pot?
Regards,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Current Projects:
Robot Control Via Skype API - Dev Stage(50% Complete) - Total(25%)
Robot Localization Via Xbee's - Research Stage
IR Tracking with Propeller - Research Stage
Comments
You may find this gameport pinout of assistance in decoding and understanding the signals at the PC gameport connector:
http://www.technick.net/public/code/cp_dpage.php?aiocp_dp=pinconjoy_pc_game
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Genius is one percent inspiration and ninety-nine percent perspiration."
Thomas Alva Edison
Post Edited (Bruce Bates) : 2/17/2008 8:57:04 AM GMT
My problem isn't so much the actual wiring of the gameport, I simply don't have enough eletronics knowledge to know how to hook the gameport for reading by the basic stamp. I know I apply +5v to the +5v rails but with the examples in the stamp manual, all the Potentiometers had three rails(Pwr, Data, and Ground) and a gameport seems to only have two(Pwr and data). I just need to know how to get RCTIME to tell me the pot value of the axises.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Current Projects:
Robot Control Via Skype API - Dev Stage(50% Complete) - Total(25%)
Robot Localization Via Xbee's - Research Stage
IR Tracking with Propeller - Research Stage
The expensive ones have pots on the X and Y axis. Sometimes they have two on each axis·for a total of 4, but you really only need to use two.· I suppose the other two are backups for military and industrial·hardware.·I've seen beautiful ones for $125 USD.
The cheapo are just four switches triggered by a stick. Not only is this mechanically much cheaper, it is easier for a microprocessor to manage in the code. The drawback is that it would usually take at least four sense wires and a common [noparse][[/noparse]total of five wires] to hook up.
Anton's Hydra uses an old game control with the cheapo version of a joystick. You really cannot sense the difference in play or feel. But it has a 'serializer' connected to the 4 switches and other buttons·to reduce the wire count to +5, Gnd, and serial output.· The microprocessor just reads a serial in format.
You can buy from a Chicago/Las Vegas outfit, the cheapo versions in heavy duty arcade forms and they generally are all you ever need.· You can hook up the 4 switches directly.·There really isn't any need to 'serialize' unless you need the extra I/O.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PLEASE CONSIDER the following:
Do you want a quickly operational black box solution or the knowledge included therein?······
Post Edited (Kramer) : 2/18/2008 6:34:01 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
The newer USB gameport interface is really too complicated for a BasicStamp to handle without outside help from a chip that converts the USB to serial.· So, I would stay away from that sort of interface if you are just starting out.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PLEASE CONSIDER the following:
Do you want a quickly operational black box solution or the knowledge included therein?······