Bluetooth/Controller on Picaxe 28x1 Thru Laptop?

No0bert

Member
Ok, so heres the seudoschematic:

Windows Controller -> Laptop -> C Code -> Bluetooth Dongle -> BlueSMIRF -> MCU -> Actuators

Does anyone know of any C code that basically transmits packets of information (TX) from bluetooth to a bluetooth modem with UART (RX). I know I will have to configure the Baud rate and everything, and I think Hyperterminal can help with this but I am not sure.

What I basically want to do is use a standard Windows Controller on my Vista Laptop and when I use the left trigger or so, the motors on say Output 1 will go to high, and when I let go of the trigger, it will go to low.

I am thinking what I have to do is interface a controller with Hyperterminal, configure Hyperterminal to send packets thru the bluetooth dongle, and like I said, thru UART, set each output to high or low based on the pressed button


Is this practical or has been done?

Can anyone help me with this?
 
Last edited:

hippy

Ex-Staff (retired)
If your PC Bluetooth dongle has a driver which presents itself to the Windows OS as a Virtual Serial Port you should be able to use HyperTerm or any own written software to communicate with it as if it were any other serial device.

To interface a controller I expect you would have to write your own software or find something suitable someone's already written. HyperTerm really only sends what you type and displays what comes back so I wouldn't expect that to be usable with a game controller.
 

No0bert

Member
so I wouldn't expect that to be usable with a game controller.
Do you know of any suitable computer communications programs?

I think I might go with the

Zigbee

It is cheaper, has more range, and very very little, fewer interference than Bluetooth, and it is easier to setup.
 

hippy

Ex-Staff (retired)
You're still going to have to find something which can take what your controller gives and turn it into whatever the other wants. In my experience this has usually had to be self-created code.
 

No0bert

Member
You're still going to have to find something which can take what your controller gives and turn it into whatever the other wants. In my experience this has usually had to be self-created code.
But do you know of any PC communication software that will work with this?
 

papaof2

Senior Member
Not communication software. This will require some custom-written software to interface the controller to the serial port. The starter version of Visual Basic .NET is available from Microsoft for the time to download (>50MB).

This assumes that you know what's coming from the controller, how to read the controller at a relatively low level in Windows, and how to work with the serial port in Windows. None of this is trivial.

The last time someone metioned custom software on the forum, the price was 100GBP or about $150US per hour. Definitely not easy stuff or commonly available, or there would have been an offer at half or less of that quote.

John
 

No0bert

Member
Not communication software. This will require some custom-written software to interface the controller to the serial port. The starter version of Visual Basic .NET is available from Microsoft for the time to download (>50MB).

This assumes that you know what's coming from the controller, how to read the controller at a relatively low level in Windows, and how to work with the serial port in Windows. None of this is trivial.

The last time someone metioned custom software on the forum, the price was 100GBP or about $150US per hour. Definitely not easy stuff or commonly available, or there would have been an offer at half or less of that quote.

John
Alright, how do I get started, how do I view/what am I looking for when I press each button?

You think I could use a joystick emulator, maybe JoyToKey, and set each button to a different number on the keyboard, and from there...
 

hippy

Ex-Staff (retired)
Alright, how do I get started, how do I view/what am I looking for when I press each button?
That's the 64,000 dollar question. Hard to answer without more knowledge of what you actually have and how it works. I don't know what this "Windows controller" is but made a, hopefully reasonable, crystal ball guesstimate it's some sort of, or similar to, a games controller.

How does it connect to the PC though; serial, parallel, games port, USB and, if USB, HID, CDC or other type of USB device ? How it connects and what drivers it comes with will dictate how you get the information out of it or out of the Windows OS.

Windows often uses device abstractions (WDM?) to bridge between physical devices and end-user programs making it relatively easy ( allegedly ) to get at that data from the device within one's own programs. In some cases this may be well documented, what API calls to make and what format the data is in but in other cases there may be very little to work with. It may also vary between different versions of OS.

So, where to start ... split it into two parts; reading your controller and sending control commands out. There's still an uphill struggle from that point but at least you've got two separate projects which are not dependant on each other which makes the going a little easier.

You think I could use a joystick emulator, maybe JoyToKey, and set each button to a different number on the keyboard, and from there...
Possibly, but you won't have a very elegant solution compared to a purpose written program. It's a good place to start though.
 
Last edited:

No0bert

Member
games controller.
CDC or other type of USB device ? How it connects and what drivers it comes with will dictate how you get the information out of it or out of the Windows OS.
It is a wireless game controller, and connects via a 2.4GHz wireless adapter, so I should review the driver with a C Compiler?

So, where to start ... split it into two parts; reading your controller and sending control commands out. There's still an uphill struggle from that point but at least you've got two separate projects which are not dependant on each other which makes the going a little easier.



Ok so joytostick is out of the question,

thanks mate
 

hippy

Ex-Staff (retired)
It is a wireless game controller, and connects via a 2.4GHz wireless adapter, so I should review the driver with a C Compiler?
But how does the 2.4GHz receiver connect to the PC ? It's ultimately about what the Windows OS stores inside it which can then be accessed by a running application which is important here.

Ok so joytostick is out of the question,
That depends; does your controller appear to Windows as if it's a joystick ?

An alternative which may be less hassle all round ( as well as being more germane to the forum's intent ) is to find a controller ( or create one ) which can connect to a PICAXE and the PICAXE can send over the wireless link to whatever it needs to control.
 

No0bert

Member
But the problem with you last suggestion is, I want it to be wireless, and this specific controller I am trying to use hasnt been hacked like the PS2 has. I may try the same approach as people do with wireless (2.4GHz) ps2 controllers, but before I buy one, I want to ask someone who has both these products if this works.

The controller is an Xbox 360 Wireless Controller, it hasnt been formally used with MCUs like the PS2 and Gamecube controllers have, but I am very eager to get it to work, as the design is so sleek.
 

hippy

Ex-Staff (retired)
So, is the real question, "Can I connect my XBox 360 wireless controller to an MCU ( which we'll assume is a PICAXE ), and how" ?
 
Top