Shop OBEX P1 Docs P2 Docs Learn Events
Looking for Some help with code — Parallax Forums

Looking for Some help with code

Guy KGuy K Posts: 6
edited 2011-04-09 11:54 in General Discussion
If posible looking for some code help for the usb to recognize the propeller as a game controller or if someone can point me in the right direction.

Thanks

Comments

  • Zap-oZap-o Posts: 452
    edited 2011-04-08 19:56
    I am still not clear on what you want to do but ill take a stab at it.

    Using the FTDI chip you could store the "game name" in its memory and design your own device driver that can identify this.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-04-08 20:25
    This is harder than it seems. What I think you're asking to do is have some kind of program to make the Propeller look like a game controller to some game box or PC.

    There's no software that I know of that will do this although there is an object in the Object Exchange that will let the Propeller behave like a USB host (like a PC). In addition, you would need to find out what the game controller needs to look like to the USB host. There are some identification strings that have to be supplied to tell the PC what kind of device it is. You would also need to find out what registers the game controller provides and how they behave. None of this information is readily available.

    What Zap-o is suggesting is that you could design your own game controller that sends information about button pushes or knob positions or whatever to the PC over the existing serial port used for downloading programs from the PC to the Propeller (through the FTDI chip used on the PropPlug and many Propeller boards). Unfortunately, any existing games are unlikely to work with this sort of virtual communications port. Anything you write could be made to work with this scheme though.
  • Guy KGuy K Posts: 6
    edited 2011-04-09 07:40
    Let me see if I can explain this a little better. I am looking to expand my controls for Flight sim 10. I need some code for the propeller to communicate with a usb port and to be listed under the Game Controllers and to use a generic driver kinda like a usb joystick nothing special pots for axis and normaly open pb for buttons.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-04-09 07:47
    [You ain't askin for much are ya?]
    If it's not here -- http://obex.parallax.com/
    then nobody has "shared".
    You can poke/search around the Propeller Forum.
    Otherwise, you could be the first to explore this frontier
    of yours.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-04-09 07:57
    The answer is the same. It's harder than it seems, could certainly be done and be done with a Propeller, but you're going to have to do it. You might start with existing examples in some of the technical magazines like Circuit Cellar. People have published examples of a mouse done with a PIC or things like that. The existing Propeller USB host code could also help. You will achieve fame and much appreciation for the effort.
  • Guy KGuy K Posts: 6
    edited 2011-04-09 09:04
    Sounds like a good project than, thanks for the info Gents I will keep you update as to what I find..
  • Heater.Heater. Posts: 21,230
    edited 2011-04-09 11:28
    Guy K,

    With USB there is a HOST end and a DEVICE end. Your PC is the host, your mouse, joysticks, etc are the device ends.
    So for the Prop to be a USB Game controller it will need to implement the device end of the protocol.
    BradC has such a USB device implementation here http://forums.parallax.com/showthread.php?97328-USB-toys-to-play-with

    Next up you will have to implement whatever the USB standard human interface device should do.
  • Heater.Heater. Posts: 21,230
    edited 2011-04-09 11:54
    I hate point to other micros but you might get some software inspiration from here:http://www.pjrc.com/teensy/index.html
    Which of course we'd all like to see you apply that to the Prop:)
Sign In or Register to comment.