Game Controller Interface
Bill Chennault
Posts: 1,198
All--
I am in need of a game controller that has two joysticks and "several" buttons. The Logitech D Pad that I have WOULD be a perfect device, but I cannot seem to make the VB interface--part someone else's, part mine--work properly. VB sees it just fine, but gets rather stupid when it interprets the button pushes. There may be nothing better. I am an old guy and know nothing about game controllers.
What I would LIKE to have is something that I can plug into a USB port and that has either enough documentation or (dream come true), actual VB software that I could modify to suit my needs. (I am a fairly good VB programmer, but know nothing about VB Express.)
I only spent about twenty bucks on the Logitech game pad. I can afford a lot more, if there is a solid way to get VB to accept input from it.
Do you have any ideas?
Oh! Why do I need this thing? My latest machine, RC Buster needs it for his remote control mode. I gave up on the Logitech device and wrote a VB 6.0 GUI, driven by a mouse. That code works perfectly (can't beat those click events). However, a mouse driven GUI is not as user-friendly as a joystick/buttons GUI. If I could make the Logitech device fire VB click events, then I might be able to use it (while I await your guidance, I might give this a shot). In the meantime, I would certainly appreciate your advice concerning a more suitable (easier to interface) PC game controller.
RC Buster is kin to Ugly Buster. The family tree doesn't fork. It looks like a circle.
I will post a link to a site devoted to Ugly Buster and his five Stamp, multi-processing logic. I learned several very significant things with Ugly Buster. Some of them will be important to some people.
Soon, I will post a link to a site devoted to RC Buster and his single SX48 Module (a Robert Doerr design, which I will probably use for a very long time). This site will address a few often asked questions, such as 'How do I interface my PC to a Stamp?' Of course, my answers will all be couched in terms of Bluetooth, Parallax transmitter/reciever modules, and WiFi modules. A simple serial cable and interface would do the same.
In the meantime, I need game controller suggestions, please!
Thanks!
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
Post Edited (Bill Chennault) : 3/18/2009 1:22:34 AM GMT
I am in need of a game controller that has two joysticks and "several" buttons. The Logitech D Pad that I have WOULD be a perfect device, but I cannot seem to make the VB interface--part someone else's, part mine--work properly. VB sees it just fine, but gets rather stupid when it interprets the button pushes. There may be nothing better. I am an old guy and know nothing about game controllers.
What I would LIKE to have is something that I can plug into a USB port and that has either enough documentation or (dream come true), actual VB software that I could modify to suit my needs. (I am a fairly good VB programmer, but know nothing about VB Express.)
I only spent about twenty bucks on the Logitech game pad. I can afford a lot more, if there is a solid way to get VB to accept input from it.
Do you have any ideas?
Oh! Why do I need this thing? My latest machine, RC Buster needs it for his remote control mode. I gave up on the Logitech device and wrote a VB 6.0 GUI, driven by a mouse. That code works perfectly (can't beat those click events). However, a mouse driven GUI is not as user-friendly as a joystick/buttons GUI. If I could make the Logitech device fire VB click events, then I might be able to use it (while I await your guidance, I might give this a shot). In the meantime, I would certainly appreciate your advice concerning a more suitable (easier to interface) PC game controller.
RC Buster is kin to Ugly Buster. The family tree doesn't fork. It looks like a circle.
I will post a link to a site devoted to Ugly Buster and his five Stamp, multi-processing logic. I learned several very significant things with Ugly Buster. Some of them will be important to some people.
Soon, I will post a link to a site devoted to RC Buster and his single SX48 Module (a Robert Doerr design, which I will probably use for a very long time). This site will address a few often asked questions, such as 'How do I interface my PC to a Stamp?' Of course, my answers will all be couched in terms of Bluetooth, Parallax transmitter/reciever modules, and WiFi modules. A simple serial cable and interface would do the same.
In the meantime, I need game controller suggestions, please!
Thanks!
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
Post Edited (Bill Chennault) : 3/18/2009 1:22:34 AM GMT
Comments
The app will enumerate the same devices you see in control panel game controllers.
I have not tried it with a USB·game controller·but it should work.
Seems like I remember a thread you had on this topic and the code you were offered was very similar to this , but worth a try maybe.
If your interested and want to give VB Express a shot then post back and I will upload the source.
Jeff T.
I am interested in the code, but not VB Express. I THINK I can emulate whatever VB Express does in VB 6.0. I could well be wrong. Anyway, I would sure like to take a look at the code.
Thanks!
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
···· Hi there , I Would be interested in any· VB Express example code that uses Directx to access the USB
joystick that you may have? Thanks
P.S. Sorry Bill , I didn't mean to hijack your thread , but I am very interested in this !!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ D Rat
Dave Ratcliff· N6YEE
Post Edited (ratronic) : 3/18/2009 1:34:55 PM GMT
In that same sub routine is an integer variable called button which should return the value of the pressed button·, direct that variable to a textbox to see the results of a button press.
The app uses two references to DirectX Microsoft.DirectX and Microsoft.DirectX.Input which I found in the DirectX SDK from the Microsoft site.
The device selected is the first device enumerated but you should be able to alter that to allow for selecting a second device if required.
Jeff T.
No problems, mate! The more the merrier.
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
Got it!
Thanks!
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ D Rat
Dave Ratcliff· N6YEE
The code does not directly read information from the USB port it gets information from the device driver of the controller. So if the game controller is installed and visible/configurable in control panel it should be accessible whether its a USB or a 15 pin game port connector.
Jeff T.
That was a good example, this the first time I have played with the USB joystick in VB so I am just starting
to look at the different methods and propertys for it in directx. So far it's working for me. Thanks again for the
·example!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ D Rat
Dave Ratcliff· N6YEE
One controller is a tilt controller using the MEMSIC 2125 accelerometer. I use this controller for driving a tank in one of my games. Tilt the board forward and back to drive forward and back. Tilt it left and right to turn left or right.
Another is a punching bag with Flexiforce sensors. Depending on where you hit the punching bag will determine where you hit your opponent and how hard you hit them.
I'm also working on a tutorial showing how to add the Xbox 360 USB controller to your computer and use it to control a servo controller that's also connected via USB. Once I have that working, I'll add a tutorial showing how to control servos wirelessly via the Xbee and wireless Xbox 360 controller. These are a lot of fun for things like desktop missile launchers.
You can find them in the bottom section of the following page under "Advanced Gaming". They're not complete, but they do have sample code.
www.everydayxna.com/tutorials.php
Post Edited (ProxyProdigy) : 4/3/2009 2:48:11 PM GMT