Hi Frank:
Guess question would be, which type of joystick:
Currently there are three different types:
a) USB -> HID type joysticks. That is ones that you plug in, that work in similar ways as Mice or Keyboards, in that their USB descriptor data contains information about how many buttons, axis, ... And the code tries to properly map these to handle them. This for example includes the PS3 and PS4 when they are plugged into USB. I don't have any other real joysticks, but @mjs513 has one or two in this category.
b) XBox 360 and One - Plugged in USB? Actually 360 needs wireless adapter. But different code in place for these...
c) Bluetooth - Not in main branch yet - Currently only PS3 and PS4 working... Hopefully will figure out newer XBox one but ... With these:
PS4 (and likewise for BT mice and Keyboards) you need to compile in the code to do the pairing: where you have:
BluetoothController bluet(myusb, true, "0000")
And once paired you:
BluetoothController bluet(myusb)
This is similar to what the Host Shield 2 code was doing, but at some point, would be nice to rearrange the code to have a call to say start claim or pair...
But currently with PS4, you then have it running the pairing code with BT dongle plugged in, and then do the PS4 pairing (hold down share button and press PS)... And hopefully it pairs.
for PS3 they don't really support pairing over BT, so put in "Hack", that works like some of the linux apps like sixpair or the HS2 code, and put in API, that writes the pairing information over USB to the PS3... So to pair you need to have (or have had), the BT module plugged in, so we can remember the BT ADDR, and then have the PS3 plugged in (both can be plugged in HUB). Then in the JoystickBT scketch I have code in place, that if you are holding down the select button and press the PS button, it will call this API, which hopefully should program the PS3. Then you can unplug the PS3, and plug in BT and then when you press the PS button on joystick it should connect...