Forum Rule: Always post complete source code & details to reproduce any issue!
Page 5 of 5 FirstFirst ... 3 4 5
Results 101 to 112 of 112

Thread: T3.6 USB Host - Joysticks

  1. #101
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    7,826
    Quote Originally Posted by mjs513 View Post
    @KurtE
    You really filled in a lot of the missing pieces. That XBOX controller seems to be a lot different than the PlayStation controllers. Think I read somewhere that XBOX BT is kind of unique to the xbox controllers and doesn't follow the norm. Think we are seeing that now.
    xBox1 controller must be extreme given it only works on Windows 10 AFTER the Anniv Update - and no prior build or Win versions … well that and Teensy ?


    "@defragster - I kind of remember your map function when I was playing around with the ili9341 for the GPS PPS "
    I hoped to get to that again last night - but installed and tested Beta10, and this AM is going fast to lunch time, distracted trying to take pain from arms while watching a uTube about 'The First Conspiracy: The Secret Plot to Kill George Washington' … 71 minutes to the end … late again ...

  2. #102
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    4,201
    @defragster and @mjs513, so far still not on T36... , and yes you have to wonder when Windows did not support it either until the anniversary edition.

    At some point, I should also try their wireless adapter to see if it works OK. I did that earlier for XBox360 wireless...

    Currently distracted by other project of seeing if I can get the Hexapod robot working with the XL servos on OpenCM... The XBee is finally working again. Think there may have been lose connection.
    Probably should see how much of my "Phoenix" code base is working... Will be fun later to migrate to something else like T4

    But I am trying to understand some of the differences so hopefully will make progress

  3. #103
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    2,688
    Quote Originally Posted by KurtE View Post
    @defragster and @mjs513, so far still not on T36... , ….

    Currently distracted by other project of seeing if I can get the Hexapod robot working with the XL servos on OpenCM... The XBee is finally working again. Think there may have been lose connection.
    Probably should see how much of my "Phoenix" code base is working... Will be fun later to migrate to something else like T4
    Think I am going to have to get up to speed on bus servos. That swappy rover I was looking at uses 10 LewanSoul LX-16A Serial Bus Servo. Can't find them anywhere so may have to switch.

  4. #104
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,431
    Hi,

    Excuse my ignorance... I didn't follow this thread, and I'm a little confused.
    How "plug'n play" is this solution? Can I connect any simple USB joystick, and it works "out of the box" - like in Windows? Or should a hypothetical program have some kind of setup?
    Is there simple sample code I can try? A simple documentation?
    Can someone help me out? I don't like to deal with USB internals... USB and me, we don't like each other. So pls. help a noob

  5. #105
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    2,688
    Morning Frank

    Its pretty much plug and play. Only problem is, you have to eventually do is map the button values to the joystick buttons and the axes values as well - there really is no automatic way to do that.

    As for instructions - that I will leave to Kurt

  6. #106
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,431
    Ok, I'll need a "setup" - program, then. Is there an example for that ? I think it's not needed to invent new wheels here..

  7. #107
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    2,688
    The basic joystick example in the examples folder should get you started. A lot of stuff but its a start. If you look at the JoystickBT example you can see how we mapped axes to the actual joystick for the PS4.

    What kind of joystick are you planning on using?

  8. #108
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    4,201
    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...

  9. #109
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    2,688
    @KurtE

    You know you bring up a good point with your explanation. The examples that we have are good, especially since we know what they are doing, but maybe we need to do a little reorganizing of the examples, i.e., like what HS2 does.

  10. #110
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    4,201
    @mjs513, @defragster, @Paul, ...

    I agree that we can/should do more to help document things more. Not just for joysticks, but also for the other USB devices as well. Probably should be a section/thread on MIDI, HUBS, MICE, KEYBOARDS, Serial Adapters, Bluetooth - Although this gets more complicated as should I mention that currently don't support Microsoft Arc Mouse in the bluetooth section and/or Mouse section...

    What is unclear to me is, where/how best to do it.

    That is, as step 1) probably should update posting #1, to have more up to data information, like member functions, how to use... Which hardware has been tried....

    2) Maybe make a more global usbhost_t36 thread, which either a) we move all of this data into, or b) references all of the other threads.

    3) Did I hear WIKI

    4) Some new page up on PJRC main area.

  11. #111
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    2,688
    Maybe a wiki or new page in the main area. Think once XBOX one is done then it can all be finalized. Think that is the only open piece of the existing lib. Don't have a XBOX 360 controller to test with so can't be of much help there.

    Working on the examples now and can make some notes as I go on the callable functions. Then you all can decide where to put it I guess Don't think going to get much done today - too tired and head is not clear enough to sit in front of the screen if you know what I mean. Just one of those days.

    @KurtE - Question: do we need rawhid function in the examples? Also is there a good example on what I can use to test it with

  12. #112
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    4,201
    Quote Originally Posted by mjs513 View Post
    Maybe a wiki or new page in the main area. Think once XBOX one is done then it can all be finalized. Think that is the only open piece of the existing lib. Don't have a XBOX 360 controller to test with so can't be of much help there.

    Working on the examples now and can make some notes as I go on the callable functions. Then you all can decide where to put it I guess Don't think going to get much done today - too tired and head is not clear enough to sit in front of the screen if you know what I mean. Just one of those days.
    Sounds like a great idea to have some more complete examples.

    And yes I know what you mean! I am also distracted with other things. Busy with stuff trying to keep from needing doctors... Not something I would discuss on forum

    Quote Originally Posted by mjs513 View Post
    @KurtE - Question: do we need rawhid function in the examples? Also is there a good example on what I can use to test it with
    I think when I did a quick test of it, I connected a teensy 3.x to it with it running the Example Program: teensy->USB_RawHid->Basic

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •