Hacking [Tutorial] Printing Spla2n Posts with an Arduino/Teensy Board!

Which AVR are you using?


  • Total voters
    55

dj505

Inexperienced Romhacker
OP
Member
Joined
Oct 4, 2014
Messages
556
Trophies
0
Location
Most likely at the arcade
Website
www.youtube.com
XP
844
Country
Canada
Disclaimer: Yes, I have written a very similar tutorial to this one in the past. However, many changes have been made since then, and a complete rewrite is necessary to document them all without errors. Also, this is not a beginner project! If you do not have experience using boards such as the Arduino or Teensy, as well as the Windows command line, this may not be for you. A lot of debugging and troubleshooting will likely be necessary. With that in mind, let's get started!

5 years later update: This does work with Splatoon 3! It requires some minor changes though. Continue to "Programming your board" for details.
There's also a new RP2040 based project that seems to work much more reliably with Splatoon 3 that can be found here. Build instructions are in the README - I unfortunately don't have time to keep updating this guide. Big thanks to everyone still posting replies and keeping things up to date after all these years!

For those of you who may not know what this is all about, this is what I'm talking about:

This allows you to use any atmega32u4 or at90usb1286 board (as well as the Arduino Uno R3) to draw Splatoon 2 posts automatically. You can take images off the internat and convert them for use, or you can draw your own material on the PC itself and convert it to be drawn on the Switch automatically.

You'll need:
- One of the following:
- An atmega32u4 board such as the Teensy 2.0 or Arduono Lenardo
- An at90usb1286 board such as the Teensy 2.0++
- An Arduino Uno R3
-
LightningStalker's Splatmeme Printer repo
- LUFA (Lightweight USB Framework for AVRs)
- Gimp
- MinGW for Windows
- Python 2.7
- A USB C to USB A adapter to plug the Teensy into the Switch while in handheld mode (using the dock's ports can cause issues)

Here are a few boards to choose from. All the following should work:

Remember, you're not limited to just the boards you find on here. Any board you find out in the wild that uses an atmega32u4, at90usb1286, or atmega16u2 should work. These are just some that I found that are on the cheaper side, but should work just fine.

Canada:
Xcsource Teensy 2.0++ from Amazon (I'm using this one currently)
Sodial Teensy 2.0 from Amazon
Xcsource Pro Micro from Amazon
no-name Pro Micro from AliExpress
Beetle atmega32u4 mini dev board from AliExpress

USA:
(I'm in Canada and don't usually order from US-based sites so I apologize for inaccuracies)
HiLetgo Pro Micro from Amazon
OSOYOO Pro Micro from Amazon
TENSTAR ROBOT Pro Micro from AliExpress
Beetle atmega32u4 mini dev board from AliExpress

Setting up the repository for use
First off, you'll want to acually get the stuff up and running. Here's how you do that.
  1. Make a directory where you'll store everything. Something simple is fine, but I have mine in
    Code:
    C:\SwitchFightstick
  2. Open up the Splatmeme Printer .zip and go into the splatmeme-printer-master folder. Select everything inside that and extract it to the directory you made in step 1.
  3. Open up the LUFA zip and rename the "lufa-LUFA-170418" folder to "LUFA", then extract it to the directory you made in step 1.
  4. Install Python 2.7, then go to the directory it was installed to (should be C:\Python27) and find python.exe. Rename it to python2.exe and copy it to the directory you made in step 1.
  5. Install MinGW, and if it asks for packes to install alongside it, select the "basic" package (name may very, but it's something like that).
  6. Open up the Start menu on Windows and search for "path"; one of the results should be "Edit the system environment variables". Select that.
  7. At the bottom, press the "Environment variables" button.
  8. Under "System variables" (the bottom window), find "Path" and click Edit.
  9. Press "New" and add MinGW's bin directory, which should be
    Code:
    C:\MinGW\bin
    .
You should now be finished setting up.

Converting your image
Here we'll actually convert the image to a format you can use with the printer. This is where Gimp comes in.
  1. Open up Gimp and press Ctrl+N to make a new canvas. Make it 320 pixels wide and 120 pixels tall.
  2. Paste your image onto the canvas and use the resize and move tools to make it fit, or draw something entirely of your own if you like. As long as it fits on the canvas.
  3. Go to the "Image" menu on the top bar, hit "Mode" and select "Indexed"
  4. On the window that pops up, make sure you select "Use black and white (1-bit) palette" and set dithering to normal. Don't change anything else. If it doesn't look good, hit undo and mess with the contrast and stuff until it looks the way you want it.
  5. Once the image is as you want it, hit File > Export as... and navigate to the folder you made at the beginning of this guide.
  6. Set the image format as "Raw image data (.data)" and name it "image.data" (really, you can name it whatever you want as long as it ends in .data)
  7. Open up a command line and navigate to the directory you saved it to (should be the same as the one you made at the beginning of this guide)
  8. Run the command
    Code:
    python2 bin2c.py image.data
    , replacing
    Code:
    image.data
    with whatever you named it. You should now have a file called
    Code:
    image.c
    .
The image is now ready to be printed!

Programming your board
This part actually varies between boards. Select the one based on which board you have.

Splatoon 3 players:
  1. Open joystick.c in your favourite text editor.
  2. Look for the line that says
    Code:
    ReportData->Button |= SWITCH_MINUS;
    and replace
    Code:
    SWITCH_MINUS
    with
    Code:
    SWITCH_LCLICK
    .
  3. If you have issues with printing, open the makefile in your favourite text editor and try removing
    Code:
    -DZIG_ZAG_PRINTING
    .

atmega32u4:
You'll need:
- Arduino IDE

Steps:
  1. In the directory you made, find the file simply called "makefile" and open it up in your favorite text editor.
  2. Find the line that says
    Code:
    at90usb1286
    and change it to
    Code:
    atmega32u4
  3. Open up the Arduino IDE after plugging in your board and go to File > Preferences and select
    Code:
    Show verbose output during: upload
  4. Upload any sketch; doesn't matter which. You'll need part of the output shown in the command line for the next step.
  5. Find the line with the
    Code:
    avrdude
    command and copy the entire command itself and paste it into the command line. Don't hit enter yet.
  6. Replace the parts of the command that point to the directory and files and stuff with the directory you made as well as "Joystick.hex" as the target.
  7. Make sure the
    Code:
    -P/dev/xx
    portion shows the correct port number where xx is.
  8. Quickly double tap the reset button on the board and press enter on the command line. Might take a couple tries to get the right timing, but it'll work.
You can now plug your board into the Switch and begin! It should automatically select the right tool and positioning of the cursor.

at90usb1286:
You'll need:
- The Teensy Loader program
  1. Unzip teensy_loader_cli.exe into the repo directory.
  2. Open a command line and navigate to the repo directory.
  3. You should already have the image.c file you made in the last portion of this guide. Run the command
    Code:
    make
    and it should beign to compile. If you get an error, open up the makefile in a text editor again and make sure the LUFA path is set correctly, as well as everything else.
  4. Run the command
    Code:
    teensy_loader_cli -mmcu=at90usb1286 -w Joystick.hex
    , then press the button on your Teensy. It should upload.
You can now plug your board into the Switch and begin! It should automatically select the right tool and positioning of the cursor.

Arduino Uno R3:
You'll need:
- Set the Arduino to DFU mode (note that to get the original Arduino functionality back, you'll need to re-flash the original firmware)
  1. Open up the makefile in your favorite text editor and replace
    Code:
    at90usb1286
    with
    Code:
    atmega16u2
  2. Open up a command line and navigate to the folder, then run the command
    Code:
    make
    . You should be left with a Joystick.hex file along with multiple others that you won't need.
  3. Follow these instructions to flash the .hex file to the Uno while it's in DFU mode
You can now plug your board into the Switch and begin! It should automatically select the right tool and positioning of the cursor.

Troubleshooting / Common Issues
Image is inverted:
  • Go back into the image in GIMP: Colors > Map > Rearrange Colormap
  • (drag/drop) swap positions of black & white.
  • export, build, make, transfer, print!
And you're done! I've only personally tested the at90usb1286 portion of the guide, which worls flawlessly. It's up to you guys to test the rest of it! If you have any issues or questions, feel free to ask, and I'll help as much as I can.

Edit: Please excuse the formatting with the code windows, I expected them to be inline text and not separate boxes haha
 
Last edited by dj505,

dj505

Inexperienced Romhacker
OP
Member
Joined
Oct 4, 2014
Messages
556
Trophies
0
Location
Most likely at the arcade
Website
www.youtube.com
XP
844
Country
Canada
Stupid question since I don't have the game but these posts go where...?
Once you post them, they also get posted to either your Facebook or Twitter depending on what you have linked. They also show in-game above your character while you're online and can be seen by others.
 

BlastedGuy9905

where's the updated autopsy report
Member
Joined
Apr 13, 2017
Messages
2,334
Trophies
1
Age
33
Location
under your desk
XP
4,043
Country
United States

dj505

Inexperienced Romhacker
OP
Member
Joined
Oct 4, 2014
Messages
556
Trophies
0
Location
Most likely at the arcade
Website
www.youtube.com
XP
844
Country
Canada

Izotov

Well-Known Member
Newcomer
Joined
Jul 20, 2014
Messages
59
Trophies
0
Age
34
XP
355
Country
Ukraine
Looks to be a bit more expensive than lots of the microcontrollers you can buy for this tutorial (like the $5 atmega32u4 boards on AliExpress), but still kinda neat!
Coov N100 - converter for use Dualshock 3-4, xbox 360\one controllers on Switch/ On aliexpress cost 10$
 

MegaMagikarp

Well-Known Member
Newcomer
Joined
Mar 25, 2015
Messages
83
Trophies
0
Location
California
XP
664
Country
Taiwan
I just took a look at this fork of the repo and I see that they made a "png2c.py" so does it mean we can now directly convert png files from Photoshop or other image editing software? I've always had weird experience with gimp so that would be really helpful.

F̶o̶r̶ ̶s̶o̶m̶e̶ ̶r̶e̶a̶s̶o̶n̶ ̶a̶t̶ ̶f̶i̶r̶s̶t̶ ̶l̶o̶o̶k̶ ̶I̶ ̶t̶h̶o̶u̶g̶h̶t̶ ̶L̶i̶g̶h̶t̶n̶i̶n̶g̶S̶t̶a̶l̶k̶e̶r̶'̶s̶ ̶G̶i̶t̶H̶u̶b̶ ̶p̶r̶o̶f̶i̶l̶e̶ ̶p̶h̶o̶t̶o̶ ̶i̶s̶ ̶s̶o̶m̶e̶ ̶a̶n̶i̶m̶e̶ ̶c̶h̶a̶r̶a̶c̶t̶e̶r̶…̶ ̶w̶a̶s̶ ̶d̶i̶s̶a̶p̶p̶o̶i̶n̶t̶e̶d̶ ̶a̶f̶t̶e̶r̶ ̶l̶o̶o̶k̶e̶d̶ ̶c̶l̶o̶s̶e̶l̶y̶ ̶
 
Last edited by MegaMagikarp,

dj505

Inexperienced Romhacker
OP
Member
Joined
Oct 4, 2014
Messages
556
Trophies
0
Location
Most likely at the arcade
Website
www.youtube.com
XP
844
Country
Canada
I just took a look at this fork of the repo and I see that they made a "png2c.py" so does it mean we can now directly convert png files from Photoshop or other image editing software? I've always had weird experience with gimp so that would be really helpful.

F̶o̶r̶ ̶s̶o̶m̶e̶ ̶r̶e̶a̶s̶o̶n̶ ̶a̶t̶ ̶f̶i̶r̶s̶t̶ ̶l̶o̶o̶k̶ ̶I̶ ̶t̶h̶o̶u̶g̶h̶t̶ ̶L̶i̶g̶h̶t̶n̶i̶n̶g̶S̶t̶a̶l̶k̶e̶r̶'̶s̶ ̶G̶i̶t̶H̶u̶b̶ ̶p̶r̶o̶f̶i̶l̶e̶ ̶p̶h̶o̶t̶o̶ ̶i̶s̶ ̶s̶o̶m̶e̶ ̶a̶n̶i̶m̶e̶ ̶c̶h̶a̶r̶a̶c̶t̶e̶r̶…̶ ̶w̶a̶s̶ ̶d̶i̶s̶a̶p̶p̶o̶i̶n̶t̶e̶d̶ ̶a̶f̶t̶e̶r̶ ̶l̶o̶o̶k̶e̶d̶ ̶c̶l̶o̶s̶e̶l̶y̶ ̶
Yeah, you can convert PNG files now!
 
  • Like
Reactions: BlastedGuy9905

crk14341

New Member
Newbie
Joined
Aug 30, 2017
Messages
3
Trophies
0
Age
25
XP
41
Country
United States
So I've gotten through most of the guide and I'm having a bit of trouble when it comes to making the hex file. I'll go to make the file and I'll get this error. What can I do to solve this?
 

Attachments

  • Capture.PNG
    Capture.PNG
    1.7 KB · Views: 680

dj505

Inexperienced Romhacker
OP
Member
Joined
Oct 4, 2014
Messages
556
Trophies
0
Location
Most likely at the arcade
Website
www.youtube.com
XP
844
Country
Canada
So I've gotten through most of the guide and I'm having a bit of trouble when it comes to making the hex file. I'll go to make the file and I'll get this error. What can I do to solve this?
When you installed MinGW, did you also install the basic package? Make sure it's installed, and that everything was added to the PATH properly, then reboot
 

crk14341

New Member
Newbie
Joined
Aug 30, 2017
Messages
3
Trophies
0
Age
25
XP
41
Country
United States
When you installed MinGW, did you also install the basic package? Make sure it's installed, and that everything was added to the PATH properly, then reboot
I've double checked both the installed packages and the PATH and I'm still getting the error. I've even rebooted a couple of times. Do you have any other ideas?
 

HamBone41801

Vipera’s Alt
Member
Joined
Jan 16, 2017
Messages
1,083
Trophies
0
Age
22
XP
964
Country
United States
look, I'm gonna be honest with you. this guide is a mess. you didn't even mention the splatmeme repo past the fact that it's required. you also confused usb type a and usb type micro-b (which is what the Teensy ACTUALLY uses). you then failed to mention the required adapters/cables for the other two boards, as well as which (if any) extra packages would be required when installing minGW. please, put more work into your guides next time. the only reason I got it to work is because I already knew what I was doing.
 

Hopeywolf

Member
Newcomer
Joined
Jun 26, 2017
Messages
6
Trophies
0
Age
33
XP
43
Country
United States
so Ive followed everything and when I try to make it shows

makefile:30: ../LUFA/LUFA/Build/lufa_core.mk: No such file or directory
makefile:31: ../LUFA/LUFA/Build/lufa_sources.mk: No such file or directory
makefile:32: ../LUFA/LUFA/Build/lufa_build.mk: No such file or directory
makefile:33: ../LUFA/LUFA/Build/lufa_cppcheck.mk: No such file or directory
makefile:34: ../LUFA/LUFA/Build/lufa_doxygen.mk: No such file or directory
makefile:35: ../LUFA/LUFA/Build/lufa_dfu.mk: No such file or directory
makefile:36: ../LUFA/LUFA/Build/lufa_hid.mk: No such file or directory
makefile:37: ../LUFA/LUFA/Build/lufa_avrdude.mk: No such file or directory
makefile:38: ../LUFA/LUFA/Build/lufa_atprogram.mk: No such file or directory
make: *** No rule to make target `../LUFA/LUFA/Build/lufa_atprogram.mk'. Stop.

Everything is done properly so far, only confusing part is the MinGW part where it gives a list of packages
 
Last edited by Hopeywolf,

HamBone41801

Vipera’s Alt
Member
Joined
Jan 16, 2017
Messages
1,083
Trophies
0
Age
22
XP
964
Country
United States
so Ive followed everything and when I try to make it shows

makefile:30: ../LUFA/LUFA/Build/lufa_core.mk: No such file or directory
makefile:31: ../LUFA/LUFA/Build/lufa_sources.mk: No such file or directory
makefile:32: ../LUFA/LUFA/Build/lufa_build.mk: No such file or directory
makefile:33: ../LUFA/LUFA/Build/lufa_cppcheck.mk: No such file or directory
makefile:34: ../LUFA/LUFA/Build/lufa_doxygen.mk: No such file or directory
makefile:35: ../LUFA/LUFA/Build/lufa_dfu.mk: No such file or directory
makefile:36: ../LUFA/LUFA/Build/lufa_hid.mk: No such file or directory
makefile:37: ../LUFA/LUFA/Build/lufa_avrdude.mk: No such file or directory
makefile:38: ../LUFA/LUFA/Build/lufa_atprogram.mk: No such file or directory
make: *** No rule to make target `../LUFA/LUFA/Build/lufa_atprogram.mk'. Stop.

Everything is done properly so far, only confusing part is the MinGW part where it gives a list of packages
you might as well just follow a video on youtube. and the basic package is all you need.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    SylverReZ @ SylverReZ: @salazarcosplay, Morning