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

Discussion in 'Switch - Hacking & Homebrew' started by dj505, Aug 25, 2017.

?

Which AVR are you using?

  1. An atmega32u4 based board

    11.8%
  2. An at90usb1286 based board

    35.3%
  3. An Arduino Uno R3 board

    52.9%
  1. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    519
    119
    Oct 4, 2014
    Canada
    Most likely at the arcade
    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!

    For those of you who may not know what this is all about, this is what I'm talking about:
    Warning: Spoilers inside!
    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:

    Warning: Spoilers inside!

    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.

    atmega32u4:
    Warning: Spoilers inside!

    at90usb1286:

    Warning: Spoilers inside!

    Arduino Uno R3:

    Warning: Spoilers inside!

    Troubleshooting / Common Issues
    Warning: Spoilers inside!
    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, Sep 9, 2017
    zaxman22 likes this.


  2. greenkoala

    greenkoala Advanced Member

    Newcomer
    55
    3
    Nov 25, 2013
    United States
    Stupid question since I don't have the game but these posts go where...?
     
  3. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    519
    119
    Oct 4, 2014
    Canada
    Most likely at the arcade
    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.
     
  4. Izotov

    Izotov Member

    Newcomer
    38
    5
    Jul 20, 2014
    Ukraine
    in last update Coov N100 added this feature
     
  5. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    519
    119
    Oct 4, 2014
    Canada
    Most likely at the arcade
    Which feature?
     
  6. Izotov

    Izotov Member

    Newcomer
    38
    5
    Jul 20, 2014
    Ukraine
  7. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    519
    119
    Oct 4, 2014
    Canada
    Most likely at the arcade
    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!
     
  8. BlastedGuy9905

    BlastedGuy9905 Ace Bricker

    Member
    1,161
    689
    Apr 13, 2017
    United States
    Outside your windows ᕙ(◔ᗜ◔)ᕗ
    Could I use this?
    https://www.aliexpress.com/item/Pro...67-414f-982e-ebe1415217eb&transAbTest=ae803_1

    — Posts automatically merged - Please don't double post! —

    (sorry if that is not even close to what you need, i never used a board like this)
     
  9. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    519
    119
    Oct 4, 2014
    Canada
    Most likely at the arcade
  10. BlastedGuy9905

    BlastedGuy9905 Ace Bricker

    Member
    1,161
    689
    Apr 13, 2017
    United States
    Outside your windows ᕙ(◔ᗜ◔)ᕗ
    Thanks :D
     
  11. Izotov

    Izotov Member

    Newcomer
    38
    5
    Jul 20, 2014
    Ukraine
    Coov N100 - converter for use Dualshock 3-4, xbox 360\one controllers on Switch/ On aliexpress cost 10$
     
  12. MegaMagikarp

    MegaMagikarp Newbie

    Newcomer
    7
    3
    Mar 25, 2015
    United States
    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, Aug 28, 2017
  13. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    519
    119
    Oct 4, 2014
    Canada
    Most likely at the arcade
    Yeah, you can convert PNG files now!
     
    BlastedGuy9905 likes this.
  14. crk14341

    crk14341 Newbie

    Newcomer
    3
    0
    Aug 30, 2017
    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?
     

    Attached Files:

  15. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    519
    119
    Oct 4, 2014
    Canada
    Most likely at the arcade
    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
     
  16. crk14341

    crk14341 Newbie

    Newcomer
    3
    0
    Aug 30, 2017
    United States
    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?
     
  17. HamBone41801

    HamBone41801 K35

    Member
    576
    333
    Jan 16, 2017
    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.
     
  18. Hopeywolf

    Hopeywolf Newbie

    Newcomer
    6
    0
    Jun 26, 2017
    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, Aug 31, 2017
  19. HamBone41801

    HamBone41801 K35

    Member
    576
    333
    Jan 16, 2017
    United States
    you might as well just follow a video on youtube. and the basic package is all you need.
     
  20. Hopeywolf

    Hopeywolf Newbie

    Newcomer
    6
    0
    Jun 26, 2017
    United States
    everything is done properly
    I get a different error for the other method ERROR 1 with Joystick.c