http://www.lvr.com/usb.htm _____ From: plug-discuss-bounces@lists.plug.phoenix.az.us [mailto:plug-discuss-bounces@lists.plug.phoenix.az.us] On Behalf Of Mike Bushroe Sent: Monday, March 02, 2009 1:41 PM To: plug-discuss@lists.plug.phoenix.az.us Subject: C code to read USB Joysticks 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