Easy way to setup the controller buttons via GPIO

Various user-contributed guides for software-related things
User avatar
tinkerBOY
Posts: 634
Joined: Tue May 30, 2017 4:00 am
Has thanked: 265 times
Been thanked: 178 times

Re: Easy way to setup the controller buttons via GPIO

Post by tinkerBOY » Wed Jul 19, 2017 6:40 pm

The audio issues has something to do with the way you setup the low pass filter, audio amp, potentiometer, & speaker i guess.

Here's mine, i followed b:
IMG_1403.PNG
IMG_1403.PNG (125.74 KiB) Viewed 3300 times
Power and the low pass filter on the left side of the audio amp.

Very loud and clear for me.
Game Boy Zero Controllers available @ tinkerBOY.xyz
tinkerBOY Controller v3.0 - built-in usb controller, usb audio, and usb hub
tinkerBOY Controller v2.0 - GPIO buttons and builtin PWM Audio and Amplifier
tinkerBOY Controller v1.1 - simple pcb button
* DPI Adapter - better display for GBZ
* keyboard converters - IBM XT/AT Soarer's Converter | ADB to USB Converter

Syntax_X
Posts: 11
Joined: Wed Jul 19, 2017 1:25 am
Has thanked: 2 times
Been thanked: 1 time

Re: Easy way to setup the controller buttons via GPIO

Post by Syntax_X » Wed Jul 19, 2017 8:12 pm

My setup is identical. Sound works fine from gpio 18 before I install your script. Its not the amps fault its software based due to the stutter and pause.

User avatar
firestw152
Posts: 79
Joined: Mon Mar 06, 2017 5:14 pm
Has thanked: 22 times
Been thanked: 3 times

Re: Easy way to setup the controller buttons via GPIO

Post by firestw152 » Wed Jul 19, 2017 8:15 pm

Syntax_X wrote:
Wed Jul 19, 2017 5:51 pm
That sound card you linked should have very nice decoupling caps but its a pain in the butt to desolder and use.
The tiny traces lift and its near impossible to remove the usb header without damaging the board.
I can't seem to find how to wire everything together but great guide. Is there a wire diagram anywhere?

User avatar
tinkerBOY
Posts: 634
Joined: Tue May 30, 2017 4:00 am
Has thanked: 265 times
Been thanked: 178 times

Re: Easy way to setup the controller buttons via GPIO

Post by tinkerBOY » Wed Jul 19, 2017 9:15 pm

Syntax_X wrote:
Wed Jul 19, 2017 8:12 pm
My setup is identical. Sound works fine from gpio 18 before I install your script. Its not the amps fault its software based due to the stutter and pause.
So how did you setup the software side of your gpio buttons before?
Game Boy Zero Controllers available @ tinkerBOY.xyz
tinkerBOY Controller v3.0 - built-in usb controller, usb audio, and usb hub
tinkerBOY Controller v2.0 - GPIO buttons and builtin PWM Audio and Amplifier
tinkerBOY Controller v1.1 - simple pcb button
* DPI Adapter - better display for GBZ
* keyboard converters - IBM XT/AT Soarer's Converter | ADB to USB Converter

Syntax_X
Posts: 11
Joined: Wed Jul 19, 2017 1:25 am
Has thanked: 2 times
Been thanked: 1 time

Re: Easy way to setup the controller buttons via GPIO

Post by Syntax_X » Wed Jul 19, 2017 9:35 pm

I tried with pwm mono audio pin 18 working fine then installed gpio button script. System hangs on loading screen. Pull 18 from pi and normal function with working buttons.

Tried with buttons working then adding pwm.
Same result.
Pwm channel 0 pauses the system pwm 1 stutter pauses.

Curious to know why but not overly worried as usb audio is a world of difference.

Syntax_X
Posts: 11
Joined: Wed Jul 19, 2017 1:25 am
Has thanked: 2 times
Been thanked: 1 time

Re: Easy way to setup the controller buttons via GPIO

Post by Syntax_X » Wed Jul 19, 2017 9:45 pm

Pwm audio did work fine with other gpio button setups but those setups did not work across all emulators like mega drive had no input.
But your script works fine with stuff all input lag.

User avatar
tinkerBOY
Posts: 634
Joined: Tue May 30, 2017 4:00 am
Has thanked: 265 times
Been thanked: 178 times

Re: Easy way to setup the controller buttons via GPIO

Post by tinkerBOY » Wed Jul 19, 2017 10:04 pm

Syntax_X wrote:
Wed Jul 19, 2017 9:45 pm
Pwm audio did work fine with other gpio button setups but those setups did not work across all emulators like mega drive had no input.
But your script works fine with stuff all input lag.
I'm assuming you used Adafruit retrogame program or something else? Because all the files that are installed by adafruit are the same files in this script. I just made the process simple.

I installed a fresh copy of RetroPie 4.2 into one my 4gb sdcards just now and installed this script. Put it in my GBZ, turned it on and after the initial retropie setup my gbz automatically rebooted, and after that everything seems to work just fine. no sound issues and buttons work fine.
Game Boy Zero Controllers available @ tinkerBOY.xyz
tinkerBOY Controller v3.0 - built-in usb controller, usb audio, and usb hub
tinkerBOY Controller v2.0 - GPIO buttons and builtin PWM Audio and Amplifier
tinkerBOY Controller v1.1 - simple pcb button
* DPI Adapter - better display for GBZ
* keyboard converters - IBM XT/AT Soarer's Converter | ADB to USB Converter

Syntax_X
Posts: 11
Joined: Wed Jul 19, 2017 1:25 am
Has thanked: 2 times
Been thanked: 1 time

Re: Easy way to setup the controller buttons via GPIO

Post by Syntax_X » Wed Jul 19, 2017 10:35 pm

I did a complete update on retropie with ssh and ps3 Bluetooth drivers enabled on 4g then copied that image to use as a base for testing.

User avatar
firestw152
Posts: 79
Joined: Mon Mar 06, 2017 5:14 pm
Has thanked: 22 times
Been thanked: 3 times

Re: Easy way to setup the controller buttons via GPIO

Post by firestw152 » Sat Jul 22, 2017 10:40 pm

Syntax_X wrote:
Wed Jul 19, 2017 10:35 pm
I did a complete update on retropie with ssh and ps3 Bluetooth drivers enabled on 4g then copied that image to use as a base for testing.
Hey so do you think you can link me to a wire diagram on the USB audio? I bought the sabrent USB one if that matters.

User avatar
tinkerBOY
Posts: 634
Joined: Tue May 30, 2017 4:00 am
Has thanked: 265 times
Been thanked: 178 times

Re: Easy way to setup the controller buttons via GPIO

Post by tinkerBOY » Sat Jul 22, 2017 10:44 pm

Sorry i have not tested any usb sound card yet. You can post a new topic.
Game Boy Zero Controllers available @ tinkerBOY.xyz
tinkerBOY Controller v3.0 - built-in usb controller, usb audio, and usb hub
tinkerBOY Controller v2.0 - GPIO buttons and builtin PWM Audio and Amplifier
tinkerBOY Controller v1.1 - simple pcb button
* DPI Adapter - better display for GBZ
* keyboard converters - IBM XT/AT Soarer's Converter | ADB to USB Converter

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest