Many axis joystick

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.
 
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.
 
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.

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
 
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?
 
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

:D

g.
 
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-Many-axis-joystick?p=41723&viewfull=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...

14040105030238576.jpg


---

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:
false alarm, at the end was my "Dear Windows". :mad:

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:
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. :D )

g.
 
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.
 
Hi phonixcomm,

This forum is dedicated to the Teensy family of boards and the PJRC products in general ;-)
 
One question, this update for big joystick is compatible with teensy 2.0 (atmega32U4)?

I think not, but can you confirm it?

Regards
 
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
 
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:
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.
 
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!!
 
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-joystick-tester/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:
@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++
 
Back
Top