-
Notifications
You must be signed in to change notification settings - Fork 435
How can I connect 32 (or some other large number) of buttons to an Arduino Leonardo or Arduino Micro that only has 13 digital pins and 6 analog/digital pins?
There are various ways this can be done.
- The Arduino website has a good example of how this can be done using a one or more SN74HC165N shift registers (see https://playground.arduino.cc/Code/ShiftRegSN74HC165N).
- Another possibility is using an encoder, like the 74LS348.
- A key matrices can also be used. A good article on key matrices can be found at http://pcbheaven.com/wikipages/How_Key_Matrices_Works/.
When I plug my Arduino Leonardo or Arduino Micro into a machine running Linux, the joystick does not appear.
or
I only see one joystick when I connect my Arduino Leonardo or Arduino Micro into a machine running Linux, but I have 2 (or more) defined.
To get this to work on Linux, you may need to adjust a setting on the usbhid driver. This can be done by editing the /boot/cmdline.txt file. Add one of the following strings to the end of the line of text in this file (there should only be one line of text in this file):
- For the Arduino Leonardo
usbhid.quirks=0x2341:0x8036:0x040
- For the Arduino Micro
usbhid.quirks=0x2341:0x8037:0x040
See the following blog article for more details: http://mheironimus.blogspot.com/2015/09/linux-support-for-arduino-leonardo.html
Thanks go out to @faxm0dem for this question and answer.