Actual project state
I realized that I’m taking this project like a summer project and I rarely work on it on the other part of the year. Last summer I was planning to finish it, I wish I could. At least I was able to work on some of the components, and that gave me the material for some blog articles.
This summer, though, I started with new ideas and new components (which you’ll see in a minute) and I’ve almost finished, I’m planning to finish it by the end of this year.
I’ve also tried to find some circuit drawing program to better explain the wiring I do on each post but I found only boring schematics drawing programs. Since I like colors I think I have to draw them myself with some graphic program. I’m also planning to make something about four more posts on this project, in which I’ll explain what I’ve done in different macro areas of the parts, and in the end some final thoughts.
Change of direction: a new case
Last summer I worked and modified a transparent-green game boy case to house all the components. After finishing the modification I wasn’t happy with the results so I decided to take a new case and modify it from the beginning. I’ve found on Ebay a kit for the “GameBoyZero project” which also has a screen protector and a modified (and clean) breadboard for the controls. With this kit, it will be much more easier handling the controls. I’m not regretting having modified (and ruined) the transparent green case, but I didn’t like it, and I wanted an opaque one. Modding this case was a lot easier this time because I’ve already done it several times, and if something is scratched on the inside, it is invisible on the outside. So the case is ready (for the second time).
For the system configuration I found an interesting tool (GitHub repository) that can convert GPIO inputs from the Raspberry in keyboard events, which is exactly what I was looking for.
In other projects I’ve seen people using an external unit (Tinsy-board) that handles the controls and it’s connected via USB to the Raspberry, but I don’t like this solution because it brings more complexity to the wiring.
After installing correctly the operating system (RetroPie), I installed this utility. The configuration is very easy and it’s all inside one text file. I founded a very explicative tutorial on Adafruit (linked in the repository).
As you can see, the configuration file is very simple: every input is related to a physical pin on the Raspberry, it’s only matter of connection.
# Sample configuration file for retrogame.
# Really minimal syntax, typically two elements per line w/space delimiter:
# 1) a key name (from keyTable.h; shortened from /usr/include/linux/input.h).
# 2) a GPIO pin number; when grounded, will simulate corresponding keypress.
# Uses Broadcom pin numbers for GPIO.
# If first element is GND, the corresponding pin (or pins, multiple can be
# given) is a LOW-level output; an extra ground pin for connecting buttons.
# A '#' character indicates a comment to end-of-line.
# File can be edited "live," no need to restart retrogame!
# Here's a pin configuration for the PiGRRL 2 project:
LEFT 4 # Joypad left
RIGHT 19 # Joypad right
UP 16 # Joypad up
DOWN 26 # Joypad down
LEFTCTRL 14 # 'A' button
LEFTALT 15 # 'B' button
Z 20 # 'X' button
X 18 # 'Y' button
SPACE 5 # 'Select' button
ENTER 6 # 'Start' button
A 12 # Left shoulder button
S 13 # Right shoulder button
ESC 17 # Exit ROM; PiTFT Button 1
1 22 # PiTFT Button 2
2 23 # PiTFT Button 3
3 27 # PiTFT Button 4
# For configurations with few buttons (e.g. Cupcade), a key can be followed
# by multiple pin numbers. When those pins are all held for a few seconds,
# this will generate the corresponding keypress (e.g. ESC to exit ROM).
# Only ONE such combo is supported within the file though; later entries
# will override earlier.
Assembling the parts
This time was easy, because I took one cable from the control board for every control in it and soldered to the specific pin in the Raspberry, as specified in the configuration file, even if in the photo you can’t see the Raspberry connected to the cables yet. Then I attached 2 more cables for R and L buttons that I will put on the back of the case. At this point, it seems like there are a lot of cables but they can be managed very easily. After finishing soldering I tested the controls with the operating system and they all works smoothly (as expected).
In this last photo I’ve mounted the screen (taken from the green case) and the screen protector in place. I have few more major topic to discuss for the mounting which I will cover in the next posts of the series. Stay tuned 🙂