Raphael Boichot's Matlab PC-to-Game-Boy-Printer interface converted to Python. With a few extras, I thought it would be more intuitive.
There are two ways to run the program: from the Python source code or as an executable (EXE).
-
Install Required Libraries: Use the following command to install the necessary libraries. Note: this is in the Python-Support-files/Python-requirements.txt:
pip install pyserial numpy pillow matplotlib opencv-python scipy pyinstaller
Run the Program: Ensure all files are in the same directory and execute
PC_Gameboy_Printer.pyin VS Code. Remember to include the ICO file from the Python-Support-Files folder.Note: Include the ICO file from the Python-Support-Files folder in the same folder as the
.pyfiles.
-
A Windows executable is provided in dist. Due to Github upload limits it is split using 7zip; use 7zip to unpack.
-
You must install PyInstaller by running this command:
pip install pyinstaller
Note: This should be included in the mentioned
.txtfile. -
Create the EXE: In the same folder as the Python files, run:
pyinstaller --onefile --icon=gameboy.ico --noconsole --add-data "gameboy.ico;." --add-data "Print_Image.py;." --add-data "Send_Packet.py;." --add-data "Add_CheckSum.py;." --add-data "AutoDetectCom.py;." --add-data "Image_Rectifier.py;." --hidden-import "scipy._lib.array_api_compat.numpy.fft" PC_Gameboy_Printer.py
Note: This will generate a
distfolder containing the EXE.
This is the program's GUI. The program will start with a fixed window size and a blank spot above the GUI buttons. The GUI window will automatically adjust the window size to the loaded picture.
-There are three options for the GUI buttons: loading the picture, feeding the paper, and printing the image.
While running the program, every time you click the feed or print button, it will auto-detect the COM the Arduino uses and create a serial connection. It will also handle closing the COM port used. This ensures a clean disconnect and prevents erroring out or having a COM Port Leak.
When you start a print, another window displays a converted version of the selected image. This image has been resized and oriented to achieve the best ratio. Finally, a dithering process converts the image to hex data, which is stored and sent to the Arduino as packets. Each red rectangle represents a section of the image the printer is printing.
-Here is the image scan window.
For the Arduino, use the .ino file for the sketch code. This will be in the Arduino_Nano_GB_Printer_Interface. Folder inside the .ino that you will load into the Arduino Board. -NOTE: this will work for both Nano and Uno boards, but you might have to change the SDA SCL pins if you want to use an OLED on a Uno. The OLED I use is a 128 x 32-pixel.
-Here is the completed device. This has an Arduino Nano, a 128x32-pixel OLED, and a custom break-out board "BOB."
Arduino setup with a 128x32-pixel OLED and custom breakout board.
Arduino setup with custom Resin printed case.
-When the Arduino boots, you will see a booting screen and a standby screen indicating that the device is ready.
-Here, each packet sent to the printer is shown. Each packet represents the red rectangle with the data of each image section.
-Here are some pictures of the GB Printer printing.
Arduino and GB Printer printing.
Arduino and GB Printer printing.
- Intuitive GUI for easy image loading and printing.
- Automatic COM port detection for seamless operation.
- Image conversion and dithering for optimal printing.
Contributions are welcome! Please open an issue or submit a pull request.



