Question How would I connect buttons to a Raspberry Pi?

Joined
Jul 14, 2020
Messages
4
Likes
1
I would like to make a Raspberry Pi portable but am not sure how to connect the buttons to the Pi itself. I plan on using a Raspberry Pi zero and I'm pretty sure that I would need a PCB that has the contacts for the buttons, but I'm not sure where to get that. Help would be greatly appreciated.
 
Joined
Jun 21, 2020
Messages
39
Likes
25
you can do a GPIO to virtual keyboard or use an USB gamepad, that is what i would do. there may be other ways of setting up buttons for the pi. as for the buttons, you can use the rubber membrane with the contacts on a PCB that is pre designed or cut from a controller. Or use tactile buttons wired directly to the GPIO/USB gamepad
 
Joined
Jul 14, 2020
Messages
9
Likes
2
Portables
1
On a raspberry pi there are many ways to connect buttons to it, but the two easiest ways are either using the Raspberry Pi's GPIO pins as button presses or using a usb hid device device like a teensy or arduino pro micro.

Benefits of using the Raspberry Pi's GPIO pins is it's free and uses less power. Downside you are stuck with only digital buttons (no analog joystick) unless you add additional hardware like a comparator or analog to digital converter. Here is an easy video tutorial to set up buttons using the gpio pins
GPIOnext

Benefits of using a teensy or arduino you can easily set up both analog joysticks and digital buttons. Downside additional hardware, higher power consumption, and takes up an usb port on the Pi. Here is a good video tutorial if you choose to go this route Arduino Gamepad
 
Top