C code to read USB Joysticks
Mike Bushroe
mbushroe at gmail.com
Mon Mar 2 13:41:23 MST 2009
I am trying to write a control program for my Underwater Robot. I plan to
use several USB Joysticks to input direction, speed, and robotic arm control
commands. I was planning on writing the control software running on the
laptop in C, with a simple loop to poll the joysticks, convert the values to
motor commands, then send the commands to the microcontroller on the robot
in a ascii string for the microcontroller to convert the motor commands into
PWM signals and switch controls.
My problem is that I have no idea how to read the values of the joystick X,
Y, and Z and buttons in C code. I have a test program that graphically shows
the joystick position and button states, so I know it can be done. But
without a sample of the interface routine, or directions on how to use an
API that someone else has provided, I am kind of stuck. I would gladly work
either in GCC on my Ubuntu system or M$ Visual Studio C, anything that will
allow me to talk to the USB devices.
Does anyone have a link to code that I can work from? Or suggestions on
where to read instructions on how to do this?
Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.PLUG.phoenix.az.us/pipermail/plug-discuss/attachments/20090302/4b8304a0/attachment.htm
More information about the PLUG-discuss
mailing list