Many axis joystick

Hey Paul,

This is exactly what I have been looking for. I write HID client drivers for our embedded OS (QNX) and I picked up a Teensy 2.0 and 3.0 (kickstarter) for the express purpose of testing the driver. So I am very glad to see this experiment as I wanted to test the limits of the driver. I'll load this up on the 3.0 I have here, I haven't looked at the code yet, however given that you have a breakout board leads me to believe that I'd need to have the same thing here, which isn't so great as I am terrible with electronics :)

Erick
 
It'd be nice to know at least a few programs that can really use so many sliders and buttons...

I would be interested to know if this can be used with MAME. There are dedicated controllers like this and these and these. For those controllers one of the key things is simultaneous buttons at once (not limited to 6 as some are). If it works I could see this being used as a controller for a MAME CP.
 
With the for 128 buttons, 6 axes, 17 sliders and 4 hats, things parsed nicely :)

http://pastebin.com/XnpWHJzU

and reports started to come in cleanly as well. I'll have to start to dump random values into each usage so I can actually test this further.

Anychance you could post the code with 8 axes as well?

Thanks,

E.
 
Maybe when there's at least a Windows test program? I

You will be pleased to know I have finally got something working. My UI only has 12 sliders but I can now read all sliders, axes , hats and buttons, I just got the ExtremeJoystick sketch to send out random values, and everything looked good.

I need to do some tidying up and add some error trapping, then I should be able to post a version for you guys to test. I may even squeeze in some more sliders to the UI.

joytest.png

I don't know if you read them Paul, but I posted some comments here about custom USB devices. I don't know if there are any other options, but at the very least the installer should warn about overwriting all files in the teensy folder.

Regards,

Les
 
In case anyone else is following this Joystick thread, here's the latest code for Teensy 3.1. Just replace these 4 files in hardware/teensy/cores/teensy3 and your joystick will become 128 buttons, 6 axes, 17 sliders and 4 hats.

I am sitting in front of a desk with 150 custom buttons, 9 sliding pots, 6 rotary encoders and a 6-axis joystick. I would dearly love to replicate it at home, and have started doing so, and I happen to have received my teensy 3.1 last week. And I have some free time coming up...

So yes, I am following it, and very much hoping to implement most of it soon. Guess I'd better go buy a hundred odd buttons.
 
I am sitting in front of a desk with 150 custom buttons, 9 sliding pots, 6 rotary encoders and a 6-axis joystick. I would dearly love to replicate it at home, and have started doing so, and I happen to have received my teensy 3.1 last week. And I have some free time coming up...
I am starting to design what I hope will be a nice small remote robot controller. I found this 3-Axis joystick w/button at RobotShop. I'm thinking that having two, or maybe even three, of these, along with some sliders, buttons, and a few hats, would make for a great controller.

Right now, I'd use one joystick for motion control, with the option to configure to use two joysticks, and the third joystick to control the pan/tilt on the front. This would suit the current configuration of my W.A.L.T.E.R. 2.0 just fine.

If I don't use two joysticks for motion, I'd configure the second one to control a second pan/tilt on the top of my robot, which I have not added yet. Now, I am thinking four joysticks would be optimum for what I want to do, now and in the future - two for motion control, and one for each pan/tilt unit. I'm going to design it around a Teensy 3.1.

Afterall, can we have too many joysticks? :)

8-Dale
 
More sliders could be possible if the resolution were decreased......
Reducing to only 12 bits would allow 22 sliders.

Regarding this, is the 'limit' the HID report size?,

I'm assuming
128 buttons @ 1bit
6 axis @ 16bit
17 sliders @ 16bit
4 hat swiches @4bit

=512 bit or 64Bytes (I remember reading that this was the largest allowed single report)

So in theory I can cut back on the number of buttons and/or reduce the resolutions on the axis (both sliders and axis) and have any number of buttons and sliders so long as it doesn't break the 64Byte limit?

Also, this is for the teensy 3.1 isn't it?
 
Last edited:
So in theory I can cut back on the number of buttons and/or reduce the resolutions on the axis (both sliders and axis) and have any number of buttons and sliders so long as it doesn't break the 64Byte limit?

Yes, the USB packet size limit is 64 bytes, and the HID code supports only single-packet reports.

You can reassign the 512 bits any way you like. All you have to do is edit the HID report descriptor, and then edit the usb_joystick.h code to put the data into the bits you allocated.

Also, this is for the teensy 3.1 isn't it?

Yes.
 
I have just uploaded Alpha 0.92 of the joystick test application for windows.

You can download it here.

It now has RawInput & DirectX input methods, and under raw input will show up to 18 sliders.

Don't forget it's Alpha so probably has bugs, please post feedback here or on my site!

Regards,

Les
 
Hello there , is this board/shield being actually sold ? if so , please provide link ... if not, i wonder what price is the author targeting and what release date he is aiming for.
 
Hello there , is this board/shield being actually sold .

I don't think it is a shield being developed, this is the code you would need for a tensey 3.1 to then go on and build the circuits for inputs (just a few multiplexers pots and buttons)
 
I'm still debating whether this belongs in a future version of Teensyduino's Tools > USB Type menu. Maybe when there's at least a Windows test program? It'd be nice to know at least a few programs that can really use so many sliders and buttons...
As soon as I have both of my robots fully operational, I'm going to start working on a wireless robot controller. This controller will have at least three 3-axis joysticks (possibly 4), some sliders, hats, and of course several buttons.

I'm looking at using this joystick, and hope to get one to play with soon. They are pretty expensive, but if they have the right specfications, I want to use them.

For instance, I could use a single one of these to control the gripper on my SES Rover (Y = raise/lower, X = open/close gripper, Z = wrist rotate). One could be used for locomotion control (Y = left motor, X = right motor, Z = rotation). Two sticks could be used for locomotion using the Y-axis of each to control left and right motors.

There are so many possible combinations for controlling robots, using this extreme joystick! :D One controller could even be used to control two robots. My controller could easily use up nine axis, with three of these joysticks, twelve axis with four of them. :)

Unfortunately, it might take me awhile to get the parts I need to start building this. :(

8-Dale
 
Hello there , is this board/shield being actually sold ?

Here's a blog post about the breakout board I made. It was designed for general purpose testing of the pins on a Teensy. I just used it for (partially) testing this joystick code, since it was sitting on my desk.

http://www.dorkbotpdx.org/blog/paul/input_output_analogdigitial_pin_test_circuit

This board isn't sold anywhere. But if you really want one, I do have several extra bare PCBs. You'd need buy all the parts elsewhere and solder all of them, which takes at least a few hours by hand soldering.
 
Hi Paul I see you've published on Hackaday, I've had a bit of success myself with my Arduino and I can confirm (well, suppose with authority) that your many axis joystick will be fully functional for virtual dj (my example is 128 * 1 bit and 48 *8 bit) and I can further suppose that any dj software that accepts HID will be too. (Ableton & Serato)

If you were wanting to tap into this DJ controller market, a return HID packet back to the 'joystick' controlling LEDs and such would be the next step and a then 2 packet reports,

I'll write up a promo-post at the VDJ forums.
 
This is awesome! I am developing my own game controllers right now with the teensy 2.0 and 3.1.

I've been keeping a close eye on this thread.

How does one integrate an encoder to one of these? My understanding on the 2.0 you use pins 5,6,7,8? I hooked one up the other day and I only had it functioning in the sketch as regular button presses. I tried using the #encoder.h and implemented the example sketch into the example joystick sketch. everything was working fine in serial mode but not back in HID mode.

Please describe as simple as possible. I am very new to this stuff.

Ill dig around and see if I can put some of these to use!

Currently i need about 32 buttons.

I would assume I can make some kind of switch matrix for this?
 
Last edited:
This is exactly what I've been looking for!

In case anyone else is following this Joystick thread, here's the latest code for Teensy 3.1. Just replace these 4 files in hardware/teensy/cores/teensy3 and your joystick will become 128 buttons, 6 axes, 17 sliders and 4 hats.

Works great as-is with Controllermate for mac os x. Seems to recognize all inputs.
 
Hi there

I'm a complete electronic dunce, trying to learn and create a lighting control board that will run using HID over the usb link. So 6 axis, 17 sliders and 128 buttons is just what I'm looking for.

My biggest problem is building the connections between the sliders, axis, buttons and the teensy3 board.

The board posted here only has 33 buttons and 14 sliders on it (I assume the 6 axis is accessed via the pins on the edge of the board).

I assume the buttons uses a mapping matrix that requires the 2 parts of the switch to connect to a number of shared lines (36 runs via 12 channels 6 rows and 6 columns). So 128 buttons would work how and be connected to the Teensy how?

Any suggestions on where to start would be appreciated.
 
A few of us up on Lynxmotion have been playing around with a DIY remote control for awhile now (first with RC output, which I converted to XBee). First versions used a Basic Atom Pro for the micro-controller, but I have played around with some different Arduino boards as well. On those we have been using a 16 button keypad (later added some external buttons as well), that we read in on 8 IO pins (4x4, later 4x5 for external switches).

A diagram showing the keypad wiring is up on the posting: http://www.lynxmotion.net/viewtopic.php?f=21&t=5447&start=91
Note the keypad is setup that each of the switches in a row are wired to each other, likewise for columns.

On these I used external PU resistors. Probably here can get away with using internal weak PU resistors. Reading the matrix, You start off with all of the rows logically set high, and then set one of them low and then look at the inputs for the columns. If you read a low value you know the button is pressed, then you go on to the next row (set the previous row back high, and set the next row low)... Actually I was concerned about setting the rows actually high as if you press multiple ones, you will can get a direct routing of a high value to a low value, so I personally instead of setting the value to a high, changed the pin to INPUT, this way it floated and if multiple buttons were pressed it relied on the PU resistors for the other side to read high... (Sorry if I did not explain that very well).

Another approach if you have spare Analog pins available is using setting them up with a resister network, such as described in: http://forum.arduino.cc/index.php/topic,8558.0.html
 
A few of us up on Lynxmotion have been playing around with a DIY remote control for awhile now (first with RC output, which I converted to XBee). First versions used a Basic Atom Pro for the micro-controller, but I have played around with some different Arduino boards as well. On those we have been using a 16 button keypad (later added some external buttons as well), that we read in on 8 IO pins (4x4, later 4x5 for external switches).
Yes, indeed! You, and others there, have done great work on these controllers. I'm going to be taking a closer look at your work as I start my own controller design. It would be really interesting to see what you could do with a Teensy 3.1 in your design. :)

8-Dale
 
Ok so some more digging has me thinking. Let's start with my goal. It is based on the above post re a joystick of 128x1bit (buttons) and 48x8bit (sliders/axis etc) to build a control system for lighting control software (QLC+).

So as a noob I was confused about the pin descriptions of the teensy, until I read the USB-midi page. It includes a circuit diagram to connect many 74HC4051 integrated circuits to handle lots of buttons and sliders. Buttons going to a digital pin and sliders going to an analog pin. One has to use 3 digital pins that connect to all the 74HC4051 (a "bus" of some sort?) and then each of them additionally occupies either a digital or a analog pin on the teensy.

I was already aware of the button matrix method (from the BU0836A). So my first question now is this: If we use the row/column button matrix, then a 8x8 button pad (8 rows and 8 columns) would use 2 of 74HC4051 chips? They both have 8 channels and the matrix works on detecting which rows and which columns have been switched so that will work? The issue then becomes to write the software to read the signals on the eight columns an rows and interpret that to find out which buttons have been pressed. and then in turn to send this through to the HID packet.

My second question relates to the other pieces of hardware. For my goal, I do not need LED's, maybe later but not now. I also need just a signal that a button has been pressed (momentary on), so there is no latching logic required - again maybe later but not now. My initial build will probably be two 8x8 button matrices made of B3F square switches. Now the question is this: Apart from serial diodes, what other electronics needs to be fitted to the button circuit to make it work with the 74HC4051 chips?

The same question relates to the sliders. There will be 48 potentiometers (5k ohm, I guess) that each connects to 1 pin on the 74HC4051 , which in turn uses 1 analogue pin on the teensy and share the same 3 digital pins with the 74HC4051 used for the switches. What other circuit components are needed to make this work?

The USB-midi example seems to suggest: none!

So my joystick plan is this:

1. Buttons on an 8x8 keypad (with serial diodes) made in the configuration of 8 rows by 8 columns and each row and column mapping to a channel on a 74HC4051. For 128 buttons that would be four 74HC4051 chips using 3 (common) teensy digital pins plus 4 additional digital pins.

2. Sliders have one leg linked to a channel on the 74HC4051. So for 48 sliders that gives me six 74HC4051 chips, using the same 3 common chips as the buttons plus 6 more analog chips.

3. Teensy software to read and calculate button states and set the appropriate bits in the HID packet. The same software should read the values from the faders and convert it to 8 bits. This software is also a grey area to me. I'm hoping some the Teensy guru's will help here.

4. Teensy software to create the appropriate HID headers etc to make it readable by the lighting controller software.

If I can build a 128 button 48 fader joystick to run my lights, it would be fantastic!! This is exciting.

Please advise this (an hopefully future) noob(s).
 
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!]
 
Last edited:
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.

I am also awaiting an answer for this. I need to know how to hook up the matrix. Good luck with your projects!
 
stevos758, if the board uses a "typical" row & column matrix, this should work:
ematrix.png


I drew that up about 14 years ago (wow!) to help explain how switch matrices could be wired up to the R&R Electronics EPIC controller. Think of the "DBx" labels as "Row x" and the "Mod x, Row y" labels as "Column x"

It wouldn't take much work to convert that to a little PCB that could support row & column terminal blocks with the diodes stand on end between them.

Here's another question - with the Teensy 3.1 configured as this "mega" joystick, would it still be possible to communicate with it? I ask because it would be nice to be able to write a configuration tool that would allow you to reverse axes, tweak dead zones, adjust response curves, etc.

g.
 
stevos758, if the board uses a "typical" row & column matrix, this should work:
ematrix.png


I drew that up about 14 years ago (wow!) to help explain how switch matrices could be wired up to the R&R Electronics EPIC controller. Think of the "DBx" labels as "Row x" and the "Mod x, Row y" labels as "Column x"

It wouldn't take much work to convert that to a little PCB that could support row & column terminal blocks with the diodes stand on end between them.

Here's another question - with the Teensy 3.1 configured as this "mega" joystick, would it still be possible to communicate with it? I ask because it would be nice to be able to write a configuration tool that would allow you to reverse axes, tweak dead zones, adjust response curves, etc.

g.

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