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

Thread: T3.6 USB Host - Joysticks

  1. #101
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    8,391
    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,581
    @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
    3,240
    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,567
    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
    3,240
    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,567
    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
    3,240
    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,581
    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
    3,240
    @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,581
    @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
    3,240
    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,581
    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

  13. #113
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    4,581
    For what it is worth, yesterday I received an RC Radio system I ordered, to try out on a robot... Nice thing about it is, that the receiver can be configured to receive the channels using Serial at 115200... But yesterday I noticed that it can hook up USB and work as a HID device, So I thought I would try it out...

    It worked:
    Code:
    USB Host Joystick Testing
    *** Device HID1 284e:7fff - connected ***
      manufacturer: Flysky
      product: FS-i6S emulator
      Serial: A78519D90FCA
    *** HID Device joystick[0H] 284e:7fff - connected ***
      manufacturer: Flysky
      product: FS-i6S emulator
      Serial: A78519D90FCA
    Joystick(0): buttons = 15 0:127 1:127 2:127 3:127 4:127 5:127
    Joystick(0): buttons = 15 0:127 1:127 2:130 3:127 4:127 5:127
    Joystick(0): buttons = 15 0:127 1:127 2:162 3:127 4:127 5:127
    Joystick(0): buttons = 15 0:127 1:127 2:205 3:126 4:127 5:127
    Joystick(0): buttons = 15 0:127 1:127 2:232 3:127 4:127 5:127
    Joystick(0): buttons = 15 0:127 1:127 2:209 3:127 4:127 5:127
    Joystick(0): buttons = 15 0:127 1:127 2:132 3:127 4:127 5:127
    Joystick(0): buttons = 15 0:127 1:127 2:127 3:127 4:127 5:127
    The two joysticks on it output on 0-3, not sure yet what outputs on 4 and 5
    All of the buttons appear to register in the buttons field... The only thing that does not appear to output anything (yet) is two knobs vra and vrb... Which I thought might update 4 and 5 (but don't appear to)

  14. #114
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,240
    @KurtE
    Make sure you print the axes out to about 20 or so - the knobs may appear at a higher axes value or check the raw axes array. Found that might be the case with some of other strange joysticks (Logitech).

    Mike

  15. #115
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    4,581
    @mjs513 - Hopefully the Joystick code is printing out all of the values that the HID device specifies...

    I was able to now get the additional values, by reconfiguring the "Aux Channel" outputs
    So now Channel5 - is VRA and Channel 6 is VRB and 7 is SWA...
    So now when plugged in to USB the 4: and 5: columns are the two variable rotating knobs on top of display...

    More importantly I am able to get these values through Serial input... (Or could go back to PPM type stuff)... The nice thing is that the Receiver only can output 6 servo values, BUT in IBUS it can receive 10.

  16. #116
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,240
    @KurtE

    Nice. The reason I mentioned it was that at one point I didn't see some of the axes data - but we made so many changes it probably works now .

    Sounds like a cool RC radio system

  17. #117
    Junior Member
    Join Date
    Aug 2014
    Posts
    16
    Hello all,
    I am New on teensy board.
    I should like to build usb joystick to ppm signal. My goal is to use this interface with remote controller.
    What board use and where can I found code or a library that fo that ?
    Thanks for your help.
    Pierre

  18. #118
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    4,581
    @mjs513 - I am also happy that it still works The Radio appears to be a reasonable and cheap starter radio for RC, and has the added plus of these serial communications. There is supposedly some bidirectional communications capability as well. But I think it is limited to maybe sending back (voltage, throttle and maybe altitude)? Documentation is a bit sketchy, but I might try experimenting to see if I can make some of this work for something...

    @pierrottm777 - Sorry, I am not understanding your goals. This thread is about connecting up joysticks using the USB Host capabilities of the Teensy 3.6 and now the Beta 4.0, using the usbhost_t36 library. This includes joysticks such as the PS3 or PS4 and other USB joysticks that you might connect to a PC. I am not sure if you are wanting to plug in some such controller? Or do you have some controller that you wish for the Teensy to process PPM signal data? Again not sure of your project goals. You might want to start your own thread where you describe what you are trying to do.

  19. #119
    Junior Member
    Join Date
    Aug 2014
    Posts
    16
    Thanks KurtE for your answer.
    My goal is to generate a ppm signal with a teensy. The teensy receive a usb joystick pc as input and each mouvement is converted to a compatible ppm signal for use with a remote controler.

  20. #120
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    4,581
    Again sorry, not sure what hardware is available to generate a PPM signal... A long long time ago, back in the Lynxmotion days, we built an RC remote control. At that time we used some Spectrum RC controller hardware. Have no idea where he got them. They did have a specific digital inputs they expected... Been a long time since I have looked at it and it was written in basic (Atom Pro)... So my guess is, it may depend on what hardware you are trying to use to send out the PPM signals.

Posting Permissions

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