Shop OBEX P1 Docs P2 Docs Learn Events
Using a BS2 for a game controller.. — Parallax Forums

Using a BS2 for a game controller..

ryfitzger227ryfitzger227 Posts: 99
edited 2011-08-01 03:56 in BASIC Stamp
I have started the board of education with the BS2 and almost finished. Well I fly on a flight simulator a lot and was going to build a homemade flight sim cockpit. Well the modules are expensive! So I was going to build my own! My first, test, module will be a 4 toggle switch board. I was wandering how do I connect the stamp to my computer, using a usb connection, and show it as a game controller. And when it shows up as a game controller I would like for it to show up as a button.. So when I flip the switch it should show that the button was pressed and was let go, when the toggle switch is still on... If your confused please watch this video, http://www.youtube.com/watch?v=WU1e-UuUSyw . It's a video of a pulse generator, connected using a usb connection, with thoggle switches, as a game controller, for flight sim. Im not sure what chip that is, but I wanna use a BS2. Any way possible??

Thanks!!
~Ryan

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-07-31 18:19
    The IC in the youtube's board is configured (programmed) as a USB (human interface) device.
    There's not a way to program a BS2 to make a PC recognise it as such a thing.
  • ryfitzger227ryfitzger227 Posts: 99
    edited 2011-07-31 18:26
    Okay! Thanks.. thats what I needed to know.. By any chance do you know what that IC is in the video or do you know what I could use?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-07-31 18:28
    I figure it's a custom job of their/his devise.

    How much are they charging for it?
  • ryfitzger227ryfitzger227 Posts: 99
    edited 2011-07-31 18:31
    Okay.. Thanks again!
  • ryfitzger227ryfitzger227 Posts: 99
    edited 2011-07-31 18:55
    Alright! The reason why I changed this to UNSOLVED because I have to add on to this question. After doing some photo work I found out that the chip the guy used in the YouTube video was a Microchip PIC12F2550. It's used for what I need to do, make a HID . Now, is there any way possible I could maybe use the Propeller microcontroller? Or any other microcontroller Parallax sells? All I need to know is what to use. I can do the research on how to use it. Just need a starting point. Any info on how to use it would help though :)!

    Thanks once more!
    ~Ryan
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-07-31 19:10
    What it's all about -- http://www.usb.org/developers/hidpage/

    I guess the rest is up to you.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-07-31 19:26
    Well the modules are expensive!

    ???

    I just looked - they're $34. A Stamp costs more than that.
  • Desy2820Desy2820 Posts: 138
    edited 2011-07-31 20:23
    Have you considered hacking a USB computer keyboard or mouse? The idea is that your switches replace the keys. The computer will detect your creation as a "HID"-- no custom drivers. All you have to decide is what keys you want your switches to replace.

    Grab any computer keyboard/mouse, carefully take it apart, then run wires to your switches.

    The only problem with this idea is that you can't leave the switches continuously closed, they need to be momentary. A closed switch will behave the same as a stuck key! This can be corrected with additional electronics between the switches and keyboard, but makes your project slightly more difficult.

    You could also try an arcade interface. Converting old arcade cabinets and/or arcade style controls to interface to a computer running MAME is very doable. Here is an example: http://www.ultimarc.com/ipac1.html
    Another: http://www.hagstromelectronics.com/products/modules.html

    These are designed to talk to MAME, but again, the computer sees them as keyboards (or mice.)

    Does the computer have a PS2-type keyboard connector? Those requirements are simpler, and I think it could be done with a Propeller. I don't have any experience with the Propeller though, so take with a large grain of salt.

    I hope this helps!

    One last detail--when a computer boots, your "cockpit" could confuse the BIOS. Make sure you test this out by shutting down and restarting a few times.
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2011-07-31 20:51
    As PJ Allen already suggested, OP will spend far more that $34 trying to hack something together from "cheap stuff".
  • ryfitzger227ryfitzger227 Posts: 99
    edited 2011-07-31 21:15
    Desy2820 wrote: »
    Have you considered hacking a USB computer keyboard or mouse? The idea is that your switches replace the keys. The computer will detect your creation as a "HID"-- no custom drivers. All you have to decide is what keys you want your switches to replace.

    Grab any computer keyboard/mouse, carefully take it apart, then run wires to your switches.

    The only problem with this idea is that you can't leave the switches continuously closed, they need to be momentary. A closed switch will behave the same as a stuck key! This can be corrected with additional electronics between the switches and keyboard, but makes your project slightly more difficult.

    You could also try an arcade interface. Converting old arcade cabinets and/or arcade style controls to interface to a computer running MAME is very doable. Here is an example: http://www.ultimarc.com/ipac1.html
    Another: http://www.hagstromelectronics.com/products/modules.html

    These are designed to talk to MAME, but again, the computer sees them as keyboards (or mice.)

    Does the computer have a PS2-type keyboard connector? Those requirements are simpler, and I think it could be done with a Propeller. I don't have any experience with the Propeller though, so take with a large grain of salt.

    I hope this helps!

    One last detail--when a computer boots, your "cockpit" could confuse the BIOS. Make sure you test this out by shutting down and restarting a few times.

    Well see heres my problem.. My first option was an IPAC! I understand completly thats why I came here. See heres the deal with the flight sim.. When you're programming the functions into the program it shows up as a keyboard, because you can fly a plane on this sim with a keyboard! So it's not the same functions as an actual game controller switch would be. Thats why I need it to show up as a game controller! Haha. I did alot of research in the IPAC and finnaly turned it down. I thought I could use a BS2 and then saw this YouTube video and it showed this game controller device, with a toggle switch, for flight sim! That's why I know you can do it. This guy is a one man buisness so I know I can build it WAY cheaper than you can buy it! But if you think about it.. I'm buildin an actual Boeing 747 cockpit so there will be alot of switches!! There will be alot less money if I build it myself! Haha. Well thanks for thay last tip! Might need that! Thanks alot!
  • ryfitzger227ryfitzger227 Posts: 99
    edited 2011-07-31 21:27
    Thanks everyone for helping!
  • ryfitzger227ryfitzger227 Posts: 99
    edited 2011-07-31 21:28
    PJ Allen wrote: »
    ???

    I just looked - they're $34. A Stamp costs more than that.
    Okay.. haha.. see thats not what i'm talking about.. check out this website.. http://www.goflightinc.com/store/modules-c-1.html click on both links. Those are flight sim modules.. this will be something like my "test" module I would be building: http://www.goflightinc.com/store/gft...dule-p-77.html it's an 8 toggle switch module for $156.95.. So for the cost of a toggle switch, $1.29 (jameco.com), and, if a BS2 would work, a BS2, $16.99 (parallax.com) <- i would be using the interpreter chip, I would save alot of money! And I could have a couple more switches! See as I told Desy2820 i'm building a whole Boeing 747 there will be a lot of switches.. I understand that that the pulse generator is $34 but I'm also going to have some modifications. So I do need to build my own board. It's all about saving money when it comes to building a flight sim cockpit.. lol! And whats cooler to say when someone comes over saying I built that! Even the circuit boards! So it'll be fun! haha..

    thanks,
    ~Ryan
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2011-08-01 03:56
    The BS2 will not ever be detected as a USB HID device. Nor will the Propeller.

    When the BS2 & Propeller communicate over USB, they do it through a USB-serial convertor chip. That's all the chip does. It converts the signal. The best you could do with them is to send some data over a USB connection, and write your own USB "interface" driver that would sit between your flight simulator and the BS2/Propeller.

    If you want to build your own pilse generator, that's fine. If you need the pulse generator to identify as an HID device, you need something other than the BS2 or Propeller. You can find HID dev boards on SparkFun. They should give you some idea what to look for.
Sign In or Register to comment.