D
Yes, it should work. Although if you're getting one specifically for doing this project, I'd recommend getting a cheaper Teensy board clone from eBay or something, although it's up to youThis will work with this arduino uno correct?
https://www.amazon.com/Arduino-Uno-...qid=1515373164&sr=8-4&keywords=Arduino+Uno+R3
edit: better yet this comes with a bunch of stuff..which I assume will work as well since it comes with an uno r3..is anyone able to confirm this?
https://www.amazon.com/OSOYOO-proje...73334&sr=1-5&keywords=arduino+uno+r3+ethernet
Looking to expand out of this a bit, as I am already using a teensy but that is a bit limited and all of its parts seem to be in the EU hahaYes, it should work. Although if you're getting one specifically for doing this project, I'd recommend getting a cheaper Teensy board clone from eBay or something, although it's up to you
That would be pretty neat for sure! I haven't seen anything like that done yet but I don't imagine it would be too difficult. I'd give it a shot myself but I don't have the time right now.Sorry to rewrite a message, but is anyone having any luck importing this project into the Arduino IDE? Would be great for custom controllers so we could use functions such as digitalRead, etc to trigger controller button inputs.
What sort of issues?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)
I just did it, still working. This is technically a feature nintendo added themselves, so I doubt they'll remove it.Does this still work on fw 4.x?
I fixed it by compiling via linux(specifically a raspberry pi)I'm having the same issue as Sasori.
Here's how I have it set up:
SwitchFightstick [Folder]
[All Contents of Splatmeme-Printer-master]
LUFA [folder with all it's contents]
I have set the LUFA_PATH equal to the exact LUFA folder location (within the LUFA folder). I'm using an Arduino R3 so I also changed at90usb1286 to atmega16u2. I have installed all the necessary components and made sure to add the Paths as instructed.
But I keep getting an error around joystick.c
Below is the CMD outuput:
C:\SwitchFightstick>make
0 [main] sh 10372 sync_with_child: child 12804(0x1A8) died before initialization with status code 0xC0000142
236 [main] sh 10372 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
0 [main] sh 28324 sync_with_child: child 24828(0x1B4) died before initialization with status code 0xC0000142
142 [main] sh 28324 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
0 [main] sh 23336 sync_with_child: child 21328(0x1B4) died before initialization with status code 0xC0000142
288 [main] sh 23336 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
[INFO] : Begin compilation of project "Joystick"...
avr-gcc (WinAVR 20100110) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[GCC] : Compiling C file "Joystick.c"
avr-gcc -c -pipe -gdwarf-2 -g2 -mmcu=atmega16u2 -fshort-enums -fno-inline-small-functions -fpack-struct -Wall -fno-strict-aliasing -funsigned-char -funsigned-bitfields -ffunction-sections -I. -DARCH=ARCH_AVR8 -DF_CPU=16000000UL -mrelax -fno-jump-tables -x c -Os -std=gnu99 -Wstrict-prototypes -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DZIG_ZAG_PRINTING -I. -IC:\SwitchFightstick\LUFA\LUFA/.. -DARCH=ARCH_AVR8 -DBOARD=BOARD_NONE -DF_USB=16000000UL -MMD -MP -MF obj/Joystick.d Joystick.c -o obj/Joystick.o
Assembler messages:
Fatal error: can't create obj/Joystick.o: No such file or directory
Joystick.c: In function 'SetupHardware':
Joystick.c:56: warning: implicit declaration of function 'clock_prescale_set'
Joystick.c:56: error: 'clock_div_1' undeclared (first use in this function)
Joystick.c:56: error: (Each undeclared identifier is reported only once
Joystick.c:56: error: for each function it appears in.)
Any advice would be very helpful as I'm very new to programming in general!
I fixed it by compiling via linux(specifically a raspberry pi)
I'm having the same issue as Sasori.
Here's how I have it set up:
SwitchFightstick [Folder]
[All Contents of Splatmeme-Printer-master]
LUFA [folder with all it's contents]
I have set the LUFA_PATH equal to the exact LUFA folder location (within the LUFA folder). I'm using an Arduino R3 so I also changed at90usb1286 to atmega16u2. I have installed all the necessary components and made sure to add the Paths as instructed.
But I keep getting an error around joystick.c
Below is the CMD outuput:
C:\SwitchFightstick>make
0 [main] sh 10372 sync_with_child: child 12804(0x1A8) died before initialization with status code 0xC0000142
236 [main] sh 10372 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
0 [main] sh 28324 sync_with_child: child 24828(0x1B4) died before initialization with status code 0xC0000142
142 [main] sh 28324 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
0 [main] sh 23336 sync_with_child: child 21328(0x1B4) died before initialization with status code 0xC0000142
288 [main] sh 23336 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
[INFO] : Begin compilation of project "Joystick"...
avr-gcc (WinAVR 20100110) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[GCC] : Compiling C file "Joystick.c"
avr-gcc -c -pipe -gdwarf-2 -g2 -mmcu=atmega16u2 -fshort-enums -fno-inline-small-functions -fpack-struct -Wall -fno-strict-aliasing -funsigned-char -funsigned-bitfields -ffunction-sections -I. -DARCH=ARCH_AVR8 -DF_CPU=16000000UL -mrelax -fno-jump-tables -x c -Os -std=gnu99 -Wstrict-prototypes -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DZIG_ZAG_PRINTING -I. -IC:\SwitchFightstick\LUFA\LUFA/.. -DARCH=ARCH_AVR8 -DBOARD=BOARD_NONE -DF_USB=16000000UL -MMD -MP -MF obj/Joystick.d Joystick.c -o obj/Joystick.o
Assembler messages:
Fatal error: can't create obj/Joystick.o: No such file or directory
Joystick.c: In function 'SetupHardware':
Joystick.c:56: warning: implicit declaration of function 'clock_prescale_set'
Joystick.c:56: error: 'clock_div_1' undeclared (first use in this function)
Joystick.c:56: error: (Each undeclared identifier is reported only once
Joystick.c:56: error: for each function it appears in.)
Any advice would be very helpful as I'm very new to programming in general!
So I was able to get it working but it seems that the brush it selects is the larger one which the image turns into a mess after. How can i fix that
Which would have been nice to know almost exactly a year ago when I first posted thisTutorials belong in the tutorial section.
My mistake.Which would have been nice to know almost exactly a year ago when I first posted this
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:
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.
You should now be finished setting up.
- Make a directory where you'll store everything. Something simple is fine, but I have mine in
Code:C:\SwitchFightstick
- 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.
- 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.
- 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.
- 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).
- Open up the Start menu on Windows and search for "path"; one of the results should be "Edit the system environment variables". Select that.
- At the bottom, press the "Environment variables" button.
- Under "System variables" (the bottom window), find "Path" and click Edit.
- Press "New" and add MinGW's bin directory, which should be
.Code:C:\MinGW\bin
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.
The image is now ready to be printed!
- Open up Gimp and press Ctrl+N to make a new canvas. Make it 320 pixels wide and 120 pixels tall.
- 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.
- Go to the "Image" menu on the top bar, hit "Mode" and select "Indexed"
- 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.
- 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.
- 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)
- 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)
- Run the command
, replacingCode:python2 bin2c.py image.data
with whatever you named it. You should now have a file calledCode:image.data
.Code:image.c
Programming your board
This part actually varies between boards. Select the one based on which board you have.
atmega32u4:
You'll need:
- Arduino IDE
Steps:
You can now plug your board into the Switch and begin! It should automatically select the right tool and positioning of the cursor.
- In the directory you made, find the file simply called "makefile" and open it up in your favorite text editor.
- Find the line that says
and change it toCode:at90usb1286
Code:atmega32u4
- Open up the Arduino IDE after plugging in your board and go to File > Preferences and select
Code:Show verbose output during: upload
- Upload any sketch; doesn't matter which. You'll need part of the output shown in the command line for the next step.
- Find the line with the
command and copy the entire command itself and paste it into the command line. Don't hit enter yet.Code:avrdude
- 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.
- Make sure the
portion shows the correct port number where xx is.Code:-P/dev/xx
- 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.
at90usb1286:
You'll need:
- The Teensy Loader program
You can now plug your board into the Switch and begin! It should automatically select the right tool and positioning of the cursor.
- Unzip teensy_loader_cli.exe into the repo directory.
- Open a command line and navigate to the repo directory.
- You should already have the image.c file you made in the last portion of this guide. Run the command
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.Code:make
- Run the command
, then press the button on your Teensy. It should upload.Code:teensy_loader_cli -mmcu=at90usb1286 -w Joystick.hex
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)
You can now plug your board into the Switch and begin! It should automatically select the right tool and positioning of the cursor.
- Open up the makefile in your favorite text editor and replace
withCode:at90usb1286
Code:atmega16u2
- Open up a command line and navigate to the folder, then run the command
. You should be left with a Joystick.hex file along with multiple others that you won't need.Code:make
- Follow these instructions to flash the .hex file to the Uno while it's in DFU mode
Troubleshooting / Common Issues
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.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!
Edit: Please excuse the formatting with the code windows, I expected them to be inline text and not separate boxes haha
Not that I know of.I have seen a similar guide in a few sites and my primary question is can we do this with a raspberry pi with usb gadget support.