Any ideas on how to approach programming a USB joystick using the basic functions of the starter kit?
The joystick is an Attack 3 Logitech joystick, and the micro controller is the standard Arduino starter kit from RadioShack. Any ideas on how to approach this problem would be appreciated.
It would make sense to connect the joystick to a laptop, through a compiler or IDE, into the micro controller, and then to motors or something to move with the joystick for example. I am the programmer for a team creating a Remotely Operated Vehicle (ROV) and would like to incorporate Arduino a micro controller into the control system.
Thank you in advance!
Here's the Arduino product:
Just to be sure of what you're asking... You want to use an Arduino Uno as the controller (brains) of some vehicle, and you would like to interface with this vehicle using a USB joystick? The Uno would be part of the ROV, with the GPIO connected to the drive and steering motors of the vehicle (through some motor power controller circuit), and a USB cable connected to the UNO's USB port would act as the control (and power) tether for the ROV? Somewhere down the line of the tether would be your USB joystick? Is this the general idea of your plan?
You might search the forum for "joystick" for previous discussions. Generally speaking, a USB joystick can't be directly plugged into an arduino and work.
If you want the joystick connected to the Arduino over USB, that's a big deal, because you'd need the Arduino to act as a USB Host, and hardly anyone does that. The arduino Uno's Atmega328 doesn't support USB; on an official Uno, one could reprogram the 16U2 that it has to convert usb to serial to do this, but that's advanced stuff, and if you didn't know what you were doing, you could brick it (by getting the 16U2 into a bad state and not knowing how to restore it). The Micro is a better choice, since it has native USB, but even that will be difficult - particularly since it's not something that everyone and their mom is doing, so there aren't code samples everywhere (making an Arduino Micro pretend to be a USB joystick, on the other hand, that's more popular).
That said, it would probably be pretty easy (and arguably more fun) to dismember the joystick, chuck out it's electronics, and read the joystick's switches and pots with the Arduino, and react accordingly. Usually joysticks just use a pot for each axis, so you'd put one side of the pots on ground, the other on Vcc and analogRead() the middle.
I have an Attack 3 joystick that I picked up at a garage sale for a couple of bucks. I'm just starting to play with it. So far, I have written a sketch in Processing 3.5.3 that detects when I move the stick and press some of the buttons. What I will try next is to send commands out the serial port to an Arduino.