• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 266
  • Last Modified:

joystick interface

I am creating a program which needs two analog inputs from a hardware device (i.e. two variable resistors). I am convinced the easiest way to do this is through the joystick interface using the x and y co-ordinates.

The question is, how do I read the joystick port?

(or is there an easier way to read analog inputs)

0
Stuart Landreth
Asked:
Stuart Landreth
  • 2
1 Solution
 
mcriderCommented:
There are 2 Win32 APIs you can use to access the game port... joyGetDevCaps and joyGetPos.

This Microsoft KB article has an example VB project you can play with...


SAMPLE: Joystick.exe Calls the Joystick API Functions
http://support.microsoft.com/support/kb/articles/Q181/4/78.ASP 

 Hope this helps!


Cheers!
0
 
mcriderCommented:
Thanks for the points! Glad I could help!


Cheers!
0
 
DMillCommented:
I'd like to know if this works. 'Cause I think the X,Y pos is digital....like a mouse...one that counts 1's from a Deadzone...
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now