Author Topic: Sliders on a custom board?  (Read 1720 times)

0 Members and 1 Guest are viewing this topic.

Offline trenzafeeds

  • * Exquisite Elder
  • Thread Starter
  • Posts: 1352
  • Location: vt
  • **** off
Sliders on a custom board?
« on: Sat, 11 July 2015, 15:42:56 »
I'm looking to add sliders like the ones pictured on this lighting board to a board I'm building, does anyone have ideas as to how I might go about this? Is there a chance I could get a Teensy or something similar to support a slider like this? Anyone have ideas?
demik will never leave.

Unless he gets banned.

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Sliders on a custom board?
« Reply #1 on: Sat, 11 July 2015, 19:46:10 »
The question isn't will a Teensy be able to connect to sliders (it will, you just need to use an analog input pin) but more what do you actually want them to do?
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline jonlorusso

  • Posts: 27
Re: Sliders on a custom board?
« Reply #2 on: Sat, 11 July 2015, 20:25:14 »
unless you're translating slider positions to key presses, you'll need to expose the slider as a separate usb device.

Offline trenzafeeds

  • * Exquisite Elder
  • Thread Starter
  • Posts: 1352
  • Location: vt
  • **** off
Re: Sliders on a custom board?
« Reply #3 on: Sat, 11 July 2015, 22:43:32 »
The question isn't will a Teensy be able to connect to sliders (it will, you just need to use an analog input pin) but more what do you actually want them to do?
It was a bit of a lie when I said I was building a keyboard, I'm actually building a lighting programming console with mechanical switches.

unless you're translating slider positions to key presses, you'll need to expose the slider as a separate usb device.

And could this be done through the same Teensy as the board? Or would I need a separate controller to run the sliders as a separate USB device?
demik will never leave.

Unless he gets banned.

Offline Wilba

  • * Maker
  • Posts: 464
  • Location: Melbourne, Australia
  • Keyboard Stuff Person
    • wilba.tech
Re: Sliders on a custom board?
« Reply #4 on: Sun, 12 July 2015, 00:39:57 »
One microcontroller (e.g. a Teensy) can handle a switch matrix and multiple analog inputs (e.g. sliders, pots). The only limitation will be I/O pins (digital and analog).
If you have more sliders than analog input pins, you can use analog multiplexer ICs to expand the number of analog inputs.

It's certainly a lot easier to use the one microcontroller than try to get two or more working together (i.e. in a master/slave relationship) or the host needing to manage two USB HID devices or whatever.

If you can give more details about how the console needs to interact with software, I could help out more.

Offline trenzafeeds

  • * Exquisite Elder
  • Thread Starter
  • Posts: 1352
  • Location: vt
  • **** off
Re: Sliders on a custom board?
« Reply #5 on: Sun, 12 July 2015, 05:09:13 »
I may come back to you, but I don't think I'm close enough to build to get really specific (it terms of interaction). I needed to know that it could work somehow before I proceeded with the project, and I do now.
demik will never leave.

Unless he gets banned.

Offline Findecanor

  • Posts: 5040
  • Location: Koriko
Re: Sliders on a custom board?
« Reply #6 on: Sun, 12 July 2015, 09:27:54 »
Unfortunately, in the USB HID protocol media controls (volume, etc) have to be represented either as keys or as relative devices. That is why some other keyboards use rollers and knobs that can be turned forever.

If you are planning to use a special application on the host side then you could instead use HID game controls - and those support absolute values. But then any gamepad connected to the system would also affect those sliders...

Otherwise you could rewrite the USB code to support a second "interface" with your own protocol that is not HID.
An interface is like a logical device. (I suppose that is what jonlorusso was referring to...)
A device with multiple interfaces is called a "composite device". You would need to put each other interface on its own endpoint, but there should be enough of them in the ATmega32u4 for a complex keyboard and one more interface. This could require a lot more work though.

BTW, the analogue inputs on the ATmega32u6 use also the AREF pin.
🍉

Offline trenzafeeds

  • * Exquisite Elder
  • Thread Starter
  • Posts: 1352
  • Location: vt
  • **** off
Re: Sliders on a custom board?
« Reply #7 on: Sun, 12 July 2015, 13:19:56 »
Unfortunately, in the USB HID protocol media controls (volume, etc) have to be represented either as keys or as relative devices. That is why some other keyboards use rollers and knobs that can be turned forever.

If you are planning to use a special application on the host side then you could instead use HID game controls - and those support absolute values. But then any gamepad connected to the system would also affect those sliders...

Otherwise you could rewrite the USB code to support a second "interface" with your own protocol that is not HID.
An interface is like a logical device. (I suppose that is what jonlorusso was referring to...)
A device with multiple interfaces is called a "composite device". You would need to put each other interface on its own endpoint, but there should be enough of them in the ATmega32u4 for a complex keyboard and one more interface. This could require a lot more work though.

BTW, the analogue inputs on the ATmega32u6 use also the AREF pin.


The game controls sounds like the best option just at surface level. The gamepad thing shouldn't be an issue, as this is a lighting console. I won't be playing any games on it.
demik will never leave.

Unless he gets banned.