I am designing a kind of joystick with only 8 buttons. The good news is that, unlike many keyboards, you can press any of the 256 combinations and the system continues to record properly pressed.
Is based on a simple connection to port bidirectional parallel port (25 pin behind the pc), from pin 2 to 9.
The program I am developing in c + + for Windows, allows you to translate a push of the buttons on a keyboard key, transparently to the application that is using either a game, or any other.
On the hardware side there are two possibilities, which chose the second to be better in light and 8 do not have big buttons.
1)
Use buttons connected directly to ground and port. For example, the push for bit zero cablearĂa from leg 2 (entry 0) to 25 (mass). This method works because the house has a parallel port pull-up resistors (no idea as they say in Castilian) approx. 10K, which left open circuit the input to a logic 1, as Joseph explained that what is needed to handle Dip Switches.
The good thing is you do not need anything, just cable and switches.
2)
The other method is a metal band or metal parts connected to the ground pin, the fingers are closed the circuit between ground and each of the entries (may be in a grid).
The downside of this is that the skin has a resistance of about 1MegaOhm (tested with a tester from the arm to the fingertip), changes with heart rate and far outweighs the pull up the port, so if plugged directly (replacing the switch) it is likely that nothing happens when we touch the buttons.
Therefore the solution is to use ... transistors, regardless of the type NPP serves.
Luckily I found a box with (by chance) 8 BC327 PNP transistors that I had left the project in the array of LEDs (they were not needed), I think it came out as 20 cents ea
this circuit is therefore:
We can ride in a prototype (not recommended), allow to air (not recommended, the legs of transthoracic are going to break or welded to a plate or made generic for the occasion.
This mini tutorial follows. When you can put photos finished product.
For Gzaloprgm, any use of this article must maintain a link to this site.
0 comments:
Post a Comment