PDA

View Full Version : Maximum Number of Buttons



denderli
04-05-2013, 04:30 PM
I'm just getting started with this as a hobby and I have a question, but haven't been able to find an answer. From an engineering perspective, how many buttons will a USB device support?

DigiDome
04-05-2013, 05:24 PM
vague question.
or- is this an Eng101 review question?

denderli
04-05-2013, 06:09 PM
This is not a Eng101 question per se, rather it is a noob question.

I know it seems like a vague question, but since I'm new to all of this, it is a question based off of ignorance. I've scoured the web for any shred of documentation but have not been able to find anything. I would just like to know what the limitations are on the number of buttons a single USB device could accomodate and be able to address them all either independently or by using some type of matrix encoding.

I'm interested in starting a project that would need to have 200 buttons minimum, or a 20 x 10 matrix.

PaulStoffregen
04-05-2013, 10:28 PM
This question is indeed vague, even with the extra text.

With enough design work, using enough special circuitry and a custom protocol (also with custom software on the PC to receive the data), a single USB device could support millions of buttons.

A 20x10 matrix should be pretty achievable with a Teensy++ 2.0, using 30 of the 36 pins that are exposed on the outside edges. The Keypad library should be able to handle this.

http://www.pjrc.com/teensy/td_libs_Keypad.html

On the USB side, you'll need to transmit the data to the PC using some protocol. A USB keyboard only supports about 100 unique key codes corresponding to the keys on a normal keyboard. You'll need to do something like use Serial and transmit multi-byte messages, or as a USB keyboard type send more than 1 keystroke for each button.

Generally, you can get better and more helpful answers if you invest more effort to ask better, more specific questions.

denderli
04-06-2013, 03:38 AM
Thank you for the response and the informative link. I will do more research on the information that you have provided. I also appreciate not being flamed since I was unable to articulate exactly what I was looking for since I didn't know exactly how else to phrase it.