|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Emulating a Joystick
As far as I understand, the FIRST Control System requires joysticks to use the DirectInput API. I know it would be an extremely complex task, but would anyone know how I could go about making an external microcontroller look like a joystick to the driver's station? My point being I want to be able to communicate via USB with the driver's station, sending digital and analog data, NOT going through the FirstTouch I/O board (because of data size/speed limitations). Anyone know where to start?
|
|
#2
|
|||
|
|||
|
Re: Emulating a Joystick
Actually, you are looking to emulate the HID Joystick class. DirectInput is just Microsoft's method of reading from this class.
|
|
#3
|
|||
|
|||
|
Re: Emulating a Joystick
Oh! I thought DirectInput was on both sides, the firmware and the software. I've done a lot of looking at HID, but I still can't for the life of me find a good resource for learning it. Is there a better way than reading the 200 page USB documentation?
|
|
#4
|
||||
|
||||
|
Re: Emulating a Joystick
Quote:
We used this Microchip board (PIC18F87J50) as a basis: http://www.microchip.com/stellent/id...ame =en532010 We then wrote firmware for it to talk USB HID (their SDK comes with an example that acts like a mouse - we changed to act like a gamepad). Caution, however - this little device was a pain to wire to because of the pin-out. Here's a pic of the underside of our operator console, held by the student that put it together; the pic device is on the right in the picture: http://rollingthunder.smugmug.com/20...50_LMRhS-M.jpg |
|
#5
|
|||
|
|||
|
Re: Emulating a Joystick
Quote:
Can you please post the code you wrote? |
|
#6
|
|||
|
|||
|
Re: Emulating a Joystick
Just to clarify, the I/O board and joystick data are sent in the same packet to the robot. Meaning that while you will have additional fields, they are all read at 50Hz -- even the joystick buttons and axes.
Greg McKaskle |
|
#7
|
|||
|
|||
|
Re: Emulating a Joystick
I realize that it'll still update at 50Hz, but the reason I need to have faster updating is because I can send MORE data. If you do a parallel bitbang, the more data you have the longer it takes, to a pretty ridiculous level. Thanks for the help, I'll take a look at that. And yes, code examples would help!
![]() Edit: I'm thinking about using V-USB... It'll take some digging around to figure out how to work it, but I think it'll do what I need fairly well. http://www.obdev.at/products/vusb/index.html Last edited by Geek 2.0 : 20-01-2010 at 09:54. |
|
#8
|
|||
|
|||
|
Re: Emulating a Joystick
Quote:
Don't get me wrong... I'm not trying to discourage you from making a USB joystick emulator, cause that's a cool project, but I also want to make sure you are aware of all your options. Cheers! -Joe |
|
#9
|
|||
|
|||
|
Re: Emulating a Joystick
We (being a few students independently) have been designing and prototyping for a modular button box. All the modules communicate to the master module over I2C, which (in some way) communicates with the driver station. There are a few reasons why we are doing this. First of all, it is reusable. Whether we use it on a FIRST robot, an off-season robot, or anything for that matter, we control the data. So if FIRST changes something, we only need to make minimal changes to reuse the system. Also, if a module goes "bad" at a competition, we can always just pop it out and throw a new one in. We can customize HOW the data is obtained, and what from (like an SPI device, or a device with multiple analog/digital outputs, eg. blackberry trackball). We aren't limited by the number of analog/digital I/O pins that FIRST decides will be enough. Each module has 4 analog/digital inputs. There are going to be about 12 modules. Also, each module has a unique address. So if you want to rearrange the board, you don't need to reprogram.
That's the "short" version of what we're planning. ![]() |
|
#10
|
|||
|
|||
|
Re: Emulating a Joystick
Is the source for FIRST's default implementation of the Cypress PSoC board available anywhere? Is it against the rules to modify the default firmware on that board?
There is no reason you can't set up a simple system that uses an I2C controller and HID comms on the PSoC board. If we are not able to get our hands on the default firmware, you can check out this article for a start: http://www.cypress.com/?rID=39404 |
|
#11
|
|||
|
|||
|
Re: Emulating a Joystick
Quote:
Another question... Is there an application or something that I can use to see the output of a usb joystick? I need something for testing, and I don't have any way of telling what the joystick is actually outputting. Last edited by Geek 2.0 : 21-01-2010 at 13:47. |
|
#12
|
|||
|
|||
|
Re: Emulating a Joystick
Quote:
Also, R60N seems kind of silly. According to the rules, I can buy or build any HID compliant USB device to hook up to the driver's station, but I cannot use the FirstTouch (which is most likely a safer/easier avenue than building any custom electronics). Why the draconian restriction? |
|
#13
|
|||
|
|||
|
Re: Emulating a Joystick
Quote:
|
|
#14
|
||||||
|
||||||
|
Re: Emulating a Joystick
LabVIEW makes that very easy if you have HID working. Otherwise, you need something like what Tom linked.
|
|
#15
|
||||
|
||||
|
Re: Emulating a Joystick
For my senior design project 2 years ago we used one of the Cypress PSoC boards to communication via USB. It was reasonably easy to setup once you figured out how their design workflow was laid out.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 1 joystick or 2? | ChrisMcK2186 | Control System | 18 | 19-01-2007 23:42 |
| joystick ? | _GP_ | General Forum | 1 | 26-02-2004 23:10 |
| Joystick | rmmlg | Inventor | 0 | 15-02-2004 16:34 |
| No Joystick | archiver | 2001 | 2 | 24-06-2002 01:14 |
| Joystick | Absolute Value | Technical Discussion | 21 | 22-02-2002 10:56 |