Forum Rule: Always post complete source code & details to reproduce any issue!
Page 4 of 7 FirstFirst ... 2 3 4 5 6 ... LastLast
Results 76 to 100 of 169

Thread: Many axis joystick

  1. #76
    Junior Member
    Join Date
    Mar 2014
    Posts
    11
    Quote Originally Posted by stevos758 View Post
    Thanks for the Pro-Tip! I plan on making the matrix PCB with my CNC. I just need to know what pins to hook it up too. I actually don't need all of the buttons and axis. Just more buttons than the stock teensy.

    From my newb expriments you can edit and flash in minutes very easily. It's not a pain like flashing HID to Arduino Uno's

    I would also like to include some rotary encoders but I haven't figured that out yet.
    Well the idea would be to have something like Pointy's slick joystick test tool, but with a tab on it that would allow you to tweak the thing without having to deal with re-uploading firmware to it at all. It would be much more end-user friendly. There's very few cockpit builders out there that want to get drug down the rabbit hole.

    g.

  2. #77
    Junior Member
    Join Date
    Mar 2014
    Posts
    11
    steveos758, if you hadn't figured it out by now, the pin layout for the device is squirreled away in the .ino file listed in the source code post.

    The full configuration will require the use of the surface mount pads on the bottom of the Teensy 3.1 - I don't know what connector would fit there though as I'm very unfamiliar with surface mount interconnects.

    The device needs to be set up in the Arduino IDE as the Serial/Mouse/Keyboard/Joystick selection, so that leads me to think that building a serial based configuration tool is perfectly reasonable.

    g.

  3. #78
    Quote Originally Posted by f15sim View Post
    I'd like to be able to use this in a couple of different flight simulator projects I'm working on. Can someone point me to the pinout needed to wire this thing up as configured in this thread? (6 axes, 12 (17?) sliders, 128 buttons) I'm assuming that the buttons are arranged on a row/column basis. Can the buttons be wired using a diode isolation matrix in order to allow many (or all) to be closed at once?

    I'll be ordering two Teensy 3.1s in a few minutes.

    Thanks All!

    g.

    [edit: Ordered!]

    I think the whole point is , this is just the building blocks and there is no set way of wiring it up. You choose what type of analog devices and what buttons you use and then tweak the code to match. Since Paul has done all the hard work with the USB coding, which can be a nightmare to get your head around, you just have to edit the Teesny code side, which is very easy to understand and modify.

    Quote Originally Posted by f15sim View Post
    Well the idea would be to have something like Pointy's slick joystick test tool, but with a tab on it that would allow you to tweak the thing without having to deal with re-uploading firmware to it at all. It would be much more end-user friendly. There's very few cockpit builders out there that want to get drug down the rabbit hole.

    g.
    What you could have is a joystick GUI tool, something like this which would do all the coding for you.

    Regards,

    Les

  4. #79
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,682
    Quote Originally Posted by Pointy View Post
    I think the whole point is , this is just the building blocks and there is no set way of wiring it up.
    Yes, exactly.

    But maybe there should be an example program that works with a specific wiring. Maybe a large-ish circuit board with places to add connections for all the buttons, pots, etc?

  5. #80
    Junior Member
    Join Date
    Mar 2014
    Posts
    11
    Quote Originally Posted by Pointy View Post
    I think the whole point is , this is just the building blocks and there is no set way of wiring it up. You choose what type of analog devices and what buttons you use and then tweak the code to match. Since Paul has done all the hard work with the USB coding, which can be a nightmare to get your head around, you just have to edit the Teesny code side, which is very easy to understand and modify.
    Right. I just didn't happen to notice the .ino file listed when I posted that originally. The analogs are easy to nail down and I think if it's possible to use, the Arduno key matrix library would work well for the switches, but I don't know if it would work with a diode matrix.

    What you could have is a joystick GUI tool, something like this which would do all the coding for you.
    I've seen that ( and it's why I bought a Teensy to work with it), but he's not providing Windows binaries any longer (that I could find) due to some issue with a dll he's using. (there's commentary on his source repo about it)

    What I'm thinking of is something that would allow people to invert axes, adjust dead zones, etc. No "programming" per se.

    I'm interested in things that can help lower the bar for people that want to build their own flight simulator cockpits. Something like the "mega" interface that the Teensy 3.1 can do would be great, especially considering that the only device close in function (commercially) is the offerings by Leo Bodnar at over twice the price.

    Here's some of the stuff I'm working on:
    http://www.f15sim.com
    http://www.diy-cockpits.org/coll
    http://geneb.simpits.org



    g.

  6. #81
    Junior Member
    Join Date
    Mar 2014
    Posts
    11
    Quote Originally Posted by PaulStoffregen View Post
    Yes, exactly.

    But maybe there should be an example program that works with a specific wiring. Maybe a large-ish circuit board with places to add connections for all the buttons, pots, etc?
    A reference design of sorts.

    g.

  7. #82
    Junior Member
    Join Date
    Feb 2014
    Posts
    11
    Any plans for pc to device HID communication for vibration or other feedback?

  8. #83
    Member
    Join Date
    Mar 2014
    Location
    Valencia
    Posts
    58
    Hello guys

    I'm writing you about one issue that i have with this code/joystick of this thread

    http://forum.pjrc.com/threads/23681-...ll=1#post41723

    I downloaded it and i was doing tests. It works fine with one axis X (i had a potentiometer 10k). (input analogic 0)

    But now i have connected another potentiometer to input 1 (Axis Y) and in controller game/device usb i see something weird.

    In axis X is perfect, from 0 to 65535 (RAW DATA and DIRECT INPUT DATA), (With RX is ok too)

    but in AXIS Y, the value bar does something bad ->
    RAW DATA(red arrow) begin slowly and later goes quickly. But Direct Input Data goes to the maximum (65535) at the beginning (black arrow) (With AXIS Z, RZ, SLIDER is the same).

    And with AXIS RY goes slowly and later quickly , but raw data and input data is the same.

    A little crazy...



    ---

    It can be the read of package bytes data by windows? Have you tested it and works fine in your pc?

    Thanks in advance.

    Cheers

    ps=If i upload a simple sketch for reading the analogic inputs 0, 1, 2 3.... and println in serial port the value, is correct.
    Last edited by carcaes1; 04-02-2014 at 10:42 AM.

  9. #84
    Member
    Join Date
    Mar 2014
    Location
    Valencia
    Posts
    58
    false alarm, at the end was my "Dear Windows".

    In joy.cpl, i have clicked in "Restore Defaults" and returned to work.

    Last question.

    If you do not use resistors on the analog inputs, I get noise. If you use resistors 10 kohm (I'm using standard potentiometers 10k), i disable the noise, but the values in joy.cpl ​​don't move normally/linearly (the axis starts slowly and then faster, nonlinear.)

    Thanks in advance

    EDIT

    It looks like that with resistors of 20kohm works well. I will continue test them.
    Last edited by carcaes1; 04-02-2014 at 09:18 AM.

  10. #85
    Junior Member
    Join Date
    Mar 2014
    Posts
    11
    Carcaes1, make sure you're not using audio taper pots. They have a logarithmic progression to them, which appears to match what your 10K pot is doing. You want to get pots specifically labeled as linear taper. (or punt and build yourself a hall effect sensor. )

    g.

  11. #86
    Member
    Join Date
    Mar 2014
    Location
    Valencia
    Posts
    58
    Thanks f15sim.

    I have this potentiometer

    http://www.dx.com/es/p/mf-diy-10k-oh...8#.UzwHKqh_uSo

    And another 10 k lineal (i think, because i toldthe shop's clerk that i wanted a lineal pot)

    Now they are working good (after reset defaults the data value of joystick windows) and with 20 kohm resisntance.
    With 10 kohm resistance the value is not lineal....

  12. #87
    Junior Member
    Join Date
    Mar 2014
    Posts
    11
    Good to see you got it working! For "typical" joystick applications, a 100k pot has been a traditional choice, but I think that has more to do with the RC circuit that the pre-USB joystick/game interfaces used on the PC platform.

    g.

  13. #88
    Member
    Join Date
    Mar 2014
    Location
    Valencia
    Posts
    58
    Thanks again

    Now i'm using these potentiometers only for testing at the beginning.

    Cheers !!!

  14. #89
    Junior Member
    Join Date
    Apr 2014
    Posts
    1
    Hi all just found this tread... would like to get 7-8 axis on an arduino I have just picked up a Leonardo... I am waiting to test the code their.. my system IS NOT Windows! This should work in my Linux environment as well. I have wanted one of Leo's boards but never got around to throw some cash his way..
    Cris
    here is my blog:
    http://www.element14.com/community/p...oenixcomm/blog

  15. #90
    Senior Member
    Join Date
    Jan 2013
    Posts
    966
    Hi phonixcomm,

    This forum is dedicated to the Teensy family of boards and the PJRC products in general ;-)

  16. #91
    How would I add LEDs to a joystick like this? I'm creating a keypad and need about 20 Leds.

  17. #92
    Member
    Join Date
    Mar 2014
    Location
    Valencia
    Posts
    58
    One question, this update for big joystick is compatible with teensy 2.0 (atmega32U4)?

    I think not, but can you confirm it?

    Regards

  18. #93
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,682
    Quote Originally Posted by carcaes1 View Post
    One question, this update for big joystick is compatible with teensy 2.0 (atmega32U4)?
    No. The code on reply #36 is for Teensy 3.0 and 3.1 only.

  19. #94
    Member
    Join Date
    Mar 2014
    Location
    Valencia
    Posts
    58
    Quote Originally Posted by PaulStoffregen View Post
    No. The code on reply #36 is for Teensy 3.0 and 3.1 only.

    Thanks Paul.

  20. #95
    Junior Member
    Join Date
    Jun 2014
    Posts
    1
    Hi Paul,

    Firstly I'd just like to express my gratitude to you for your work. I'm an experienced web developer just entering the micro controller world and I just love what you're doing with the Teensy, it's fantastic!

    I'm very interested in the work you've been doing on this thread with this extreme joystick. I'm currently creating a custom controller for the forthcoming Elite Dangerous game and am using your extreme joystick example with a teensy and a USB host shield to hack a Saitek X52 pro HOTAS which will form part of my custom controller.

    Whilst working on this I noticed what I believe to be a minor bug in the hat(...) function in the extreme joystick usb_joystick.h

    The function as it stands will set the val variable to 1 if the direction passed in is -1 (i.e. no direction being applied to the hat).

    I believe that val should be set to 15 if no hat direction is being applied as per the hat function in usb_joystick.h that ships with Teensyduino in hardware\teensy\cores\teensy3.

    Other than the zip file in this thread is the extreme joystick source available on any source hosting e.g. Github? I plan to open source the sketch I'm using to hack the X52 (hopefuly by contributing to your USB_Host_Shield_2.0 repository) but there's a dependency on your usb_*.* files which I'd need to resolve somehow.

    Best wishes,

    Tristan

  21. #96
    Junior Member
    Join Date
    Jul 2014
    Posts
    3
    Hey Paul!

    I'm in the process of creating my own USB joystick and my goal is to have true 16 bit resolution. I was using your extreme joystick 3 code including the usb descripter and joystick files which the axes controls I checked are set to 16 bit (65536). I understand that you multiplied your analog input in your arduino sample joystick code by 64. Why is this? I noticed that by doing that it truly is still not 16 bit resolution. I can tell by looking at the raw data counts during the calibration I can see each step is 64 apart. Meaning in reality the controller is still working with 10 bit. Anotherwords if I decide not to multiply my analog output by 64 I now get a 1024 resolution range but essentially the same steps because now I can see each individual step in the raw count as I move the axis. Something seems funny with regards to the code. Is there any way in the usb_joystick.h file to change the nominal range from 1024 (10 bit) to 65536 (16 bit) so that I truly get the 16 bit resolution I'm looking for? Thanks for all the work you did with that by the way, big help!

    -Dan

    UPDATE: I figured it out.... You have to use

    analogReadResolution(bit);

    I set it to 16. Without it the analogread function defaults to 10 bits.
    Last edited by buznee; 07-20-2014 at 12:23 AM.

  22. #97
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,682
    Yes, analogRead defaults to 10 bits.

    Even if you set it to 16, the "effective number of bits" is only about 13, even if your circuitry is perfect. The lower 3 bits are always noise.

    To get "true" 16 bits, you'll need a number better ADC chip and excellent analog circuity to keep the noise very low.

  23. #98
    Junior Member
    Join Date
    Jul 2014
    Posts
    2
    Hi Paul,

    First, thank you for your work it looks awesome!! I can't wait to build a controller for my iRacing simulator.
    I do have a question about exporting the code from teensy 3.1/.0 to the teensy 2.0++, Since I'm a nob on this field (Mechanical Engineer) I would like a guidance to how I should do it. By guidance i mean links to how i do it. Or a link to a forum post about it if possible. I couldn't find something myself, and reading all this material is kinda overwhelming right now...

    Is it possible at all to do it on the teensy 2.0++? (could be dumb question but i don't know right now fully the differences between the boards)

    Thanks!!

  24. #99
    Junior Member
    Join Date
    Jul 2014
    Posts
    2
    DCS supports at least 128 buttons, 8 axes and 4 POV hats on each gaming device. I developed a joystick controller a few years ago with 248 buttons, 2 POV hats and 13 axes divided over two devices with 124 buttons, 1 POV hat and 8/5 axes each. You could download and install DCS World to test all 128 buttons. A customer of mine also developed a test utility to display all the buttons in Windows. It can be found on https://code.google.com/p/bne-joysti...source/browse/. You will also need SlimDX SDK from http://slimdx.org/download.php. Actually I have never tested it myself since I have not produced many boards since he made it.
    Last edited by brydling; 07-27-2014 at 08:16 PM.

  25. #100
    Junior Member
    Join Date
    Jul 2014
    Posts
    2
    @brydling

    Was that for me?
    Its a bit over my head. I'm not a programmer so i don't understand it. I want to know what i need to change in order to make it compatible for the teensy 2.0++

Posting Permissions

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