Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Original Challenge: *FAST* Joystick Library for QB!! ;*) !
#11
15 pins, and since the PC gameport is designed for analog joysticks, there's more to it than that:

Quote:1. Normally on idle state the capacitor C1 is fully charged (5V) and multivibator output gives out logic 1.
2. Computer writes to I/O address 201h to reset the multivibrators. The multivibrator get a triggger pulse from I/O write signal and it discharged capacitor C1. The multivibrator output goes to logic 0 because the capacitor is discharged (0V).
2. The capacitor starts to charge form the current which goes through R1 and the joystick potentiometer.
3. When the capacitor voltage reaches certain oltage threshold level, the multivibrator output goes back to logic 1.
The bigger the potentiometer resistance value is, the loger it takes from the capacitor to reach the threshold voltage. The time how long it take for each multivibator to reach the logic 1 after the triggering is measued using software and that value tells the resistance of the potentiometer (and the stick position as well because the potentiometer is connected to the stick). This simple method for measuring the resistance value is quite cheap, but not very accurate.
This simple joystick port hardware implementation (originally designed for 4.7 MHz IBM PC) causes many headaches to game programmers (problems of different computer speeds, joycitck port differences, problems in multitasking operating systems etc.). Big tolerances in joysticks and joystick ports mean that the every game must have an option to cablibrate the joystick (which actually means that the program adapts to accept the values in th range which the joystick reading routine does and then converts the values to it's internal format using the values measured in joystick calibration process).
Reply


Messages In This Thread
not an entry for this challenge, but... - by Meg - 08-23-2003, 03:01 AM
ooh nice - by Meg - 08-23-2003, 04:34 AM
Original Challenge: *FAST* Joystick Library for QB!! ;*) ! - by Plasma - 08-23-2003, 09:23 AM
STICK - by SCM - 08-24-2003, 11:46 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)