swap left and right button GPIO pins

This commit is contained in:
ohsqueezy 2023-03-30 17:12:11 -07:00
parent 52fe139702
commit fff6afac57
2 changed files with 6 additions and 6 deletions

View File

@ -15,8 +15,8 @@ except ImportError:
class Playzing(pgfw.Game):
# The GPIO pins corresponding to the buttons
PIN_BUTTON_LEFT = 23
PIN_BUTTON_RIGHT = 24
PIN_BUTTON_LEFT = 24
PIN_BUTTON_RIGHT = 23
def __init__(self, config_overrides=None):
"""

View File

@ -107,9 +107,9 @@ After setting up the Raspberry Pi and screen, build and test the gamepad.
### Buttons
Two buttons need to be connected to the Raspberry Pi's GPIO 23 and 24, and each also needs to connect to the Raspberry Pi's ground pin. In the software, the input pins are set to pull-up to create a high signal when the button is unpressed. When the button is pressed, it connects the input pin to the ground pin, and the signal is pulled low.
Two buttons need to be connected to the Raspberry Pi's GPIO 24 and 23, and each also needs to connect to the Raspberry Pi's ground pin. In the software, the input pins are set to pull-up to create a high signal when the button is unpressed. When the button is pressed, it connects the input pin to the ground pin, and the signal is pulled low.
The buttons can be connected with a regular breadboard before being soldered into the prototype breadboard. The black wires in the photo are connected to ground (pin 14 on the Pi). The yellow wire is connected to GPIO 23 (also known as pin 16), and the orange wire is connected to GPIO 24 (also known as pin 18).
The buttons can be connected with a regular breadboard before being soldered into the prototype breadboard. The black wires in the photo are connected to ground (pin 20 on the Pi). The yellow wire is connected to GPIO 24 (also known as pin 18), and the orange wire is connected to GPIO 23 (also known as pin 16).
![Buttons_on_breadboard.jpg](img/manual/Buttons_on_breadboard.jpg)
@ -123,7 +123,7 @@ If using the same JST connector linked in the supplies, use the smaller section
The placement of the JST wires may depend on the breadboard, but it is recommended to connect each wire toward the bottom (closer to the player) so that the sheathed parts of the wires can lay flat against the underside and emerge from the top (closer to the device). If preferred, the wires can be shortened and re-stripped so they fit without bending, making them easier to solder. The wires should be inserted on the underside and soldered at the top of the board.
Once the wires are soldered, connect them to the buttons using solder to create bridges between the pin holes on the underside of the board. The exact connections will depend on the board, but the ground wire should connect to both buttons (using any of the button pins), the middle wire should connect to the left button, and the last wire should connect to right button, making sure not to directly connect ground to either of the GPIO pins. In the photo, the white wire is ground, the green wire is GPIO 23, and the red wire is GPIO 24.
Once the wires are soldered, connect them to the buttons using solder to create bridges between the pin holes on the underside of the board. The exact connections will depend on the board, but the ground wire should connect to both buttons (using any of the button pins), the middle wire should connect to the left button, and the last wire should connect to right button, making sure not to directly connect ground to either of the GPIO pins. In the photo, the white wire is ground, the green wire is GPIO 24, and the red wire is GPIO 23.
![Gamepad circuit board soldered](img/manual/Gamepad_circuit_board_soldered.jpg)
@ -131,7 +131,7 @@ Hot glue the wires onto the underside of the board.
![Gamepad internal wiring glue](img/manual/Gamepad_internal_wiring_glue.jpg)
Attach the socket end of the three JST wires to the Raspberry Pi's GPIO pins 14, 16, and 18 (ground, GPIO 23, and GPIO 24). The gamepad buttons should be working to control iBitFit.
Attach the socket end of the three JST wires to the Raspberry Pi's GPIO pins 20, 18, and 16 (ground, GPIO 24, and GPIO 23). The gamepad buttons should be working to control iBitFit.
Screen mount
------------