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

Which AVR are you using?


  • Total voters
    55

Rayya

Member
Newcomer
Joined
Sep 11, 2022
Messages
8
Trophies
0
Age
29
Location
Yokohama
XP
52
Country
Japan
I'll post when I get home. Please wait.

How were you able to get your arduino to choose the left most pen option? for me it's constantly using the middle pen.





EDIT: I managed to fix the problem is an unorthodox way. This works for splatoon 3 players who want to change the pen size. This will use the smallest pen available instead of the medium sized one by default. It follows the same steps as outlined in Raaya's post except instead of the button being linked to clearing the screen, it's now used to change the pen size.

// Clear the screen if (command_count == ms_2_count(1500) || command_count == ms_2_count(3000)) ReportData->Button |= SWITCH_MINUS;

to

// Clear the screen if (command_count == ms_2_count(1500) || command_count == ms_2_count(3000)) ReportData->Button |= SWITCH_L;

Someone else out there probably knows a better way to do it, but since I have zero experience in coding anything, I figured I would just switch a command to do something else. The only downside to this is that it will start with one dot that is medium size, until it switches to the smaller pen.
There is a new fork that has been updated for splatoon 3. So you don't have to do this anymore.
https://github.com/tarxf/Splatoon-3-Post-Printer/tree/splatoon-3
I’m stuck on this as well. I’m not sure which line I need. There are multiple lines that start with avrdude. I have an Arduino Micro.
The line for AVR Dude is supposed to look like this in the Arduino IDE after the "Upload Sketch" step:
1292b5c3fd98dbe2fa728d0938795c46.png

It is the white line that goes alllllll the way across. You'd grab this line and change the .hex at the end to the location of the Joystick.hex file that you make after using the "make" command in the cmd prompt. So it would look like this:

From this:
C:\Users\xxx\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude -CC:\Users\xxx\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf -v -patmega32u4 -cavr109 -PCOM6 -b57600 -D -Uflash:w:C:\Users\xxx\AppData\Local\Temp\arduino_build_600407/sketch_sep11b.ino.hex:i

To this:
C:\Users\xxx\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude -CC:\Users\xxx\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf -v -patmega32u4 -cavr109 -PCOM6 -b57600 -D -Uflash:w:C:\Users\xxx\Desktop\Splatmeme-Printer-master\Joystick.hex:i

Don't just copy and paste what is in this post as it won't be the same directory as on your computer.


I've chugged through the instructions and am hitting a wall at this step, but I'm not seeing a Joystick.hex file, just Joystick.c and Joystick.h. Any pointers, or am I missing something obvious?
The Joystick.hex file will be created after you input the "make" command in cmd prompt like this:

https://i.gyazo.com/2138e556600491b66102cb1827dad5ab.mp4
 

BenTheOne1

New Member
Newbie
Joined
Sep 15, 2022
Messages
1
Trophies
0
Age
28
Location
Arizona
XP
22
Country
United States
Hi, I just got this all set up and working. However, the issue that I'm having is pixels overlapping each other. My guess is it's going a little too fast so it's inputting more pixels than it should? I'm not really sure. I was wondering if there is a way to slow down the speed that the buttons are imputed on the screen so it could possibly input the pixels more accurately.
 
Last edited by BenTheOne1,

mrwang

Member
Newcomer
Joined
Mar 23, 2020
Messages
7
Trophies
0
Age
24
XP
127
Country
Taiwan
I use Arduino uno R3.
Error generating hex file, what should I do?

[GCC] : Compiling C file "image.c"
avr-gcc -c -pipe -gdwarf-2 -g2 -mmcu=at90usb1286 -fshort-enums -fno-inline-small-functions -Wall -fno-strict-aliasing -funsigned-char -funsigned-bitfields -ffunction-sections -I. -DARCH=ARCH_AVR8 -DDMBS_ARCH_AVR8 -mrelax -fno-jump-tables -x c -Os -std=gnu99 -Wstrict-prototypes -DF_CPU=16000000UL -DUSE_LUFA_CONFIG_HEADER -IConfig/ -I. -I../LUFA/LUFA/.. -DARCH=ARCH_AVR8 -DBOARD=BOARD_NONE -DF_USB=16000000UL -MMD -MP -MF obj/image.d image.c -o obj/image.o
[LNK] : Linking object files into "Joystick.elf" avr-gcc obj/Joystick.o obj/Descriptors.o obj/image.o obj/HIDParser.o obj/Device_AVR8.o obj/EndpointStream_AVR8.o obj/Endpoint_AVR8.o obj/Host_AVR8.o obj/PipeStream_AVR8.o obj/Pipe_AVR8.o obj/USBController_AVR8.o obj/USBInterrupt_AVR8.o obj/ConfigDescriptors.o obj/DeviceStandardReq.o obj/Events.o obj/HostStandardReq.o obj/USBTask.o -o Joystick.elf -lm -Wl,-Map=Joystick.map,--cref -Wl,--gc-sections -Wl,--relax -mmcu=at90usb1286
[OBJCPY] : Extracting HEX file data from "Joystick.elf" avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature Joystick.elf Joystick.hex
[OBJCPY] : Extracting EEP file data from "Joystick.elf" avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings Joystick.elf Joystick.eep || exit 0
0 [main] sh 7388 sync_with_child: child 7184(0x1D0) died before initialization with status code 0xC0000142
198 [main] sh 7388 sync_with_child: * child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
make: * [Joystick.eep] Error 128
 

Rayya

Member
Newcomer
Joined
Sep 11, 2022
Messages
8
Trophies
0
Age
29
Location
Yokohama
XP
52
Country
Japan
I use Arduino uno R3.
Error generating hex file, what should I do?

[GCC] : Compiling C file "image.c"
avr-gcc -c -pipe -gdwarf-2 -g2 -mmcu=at90usb1286 -fshort-enums -fno-inline-small-functions -Wall -fno-strict-aliasing -funsigned-char -funsigned-bitfields -ffunction-sections -I. -DARCH=ARCH_AVR8 -DDMBS_ARCH_AVR8 -mrelax -fno-jump-tables -x c -Os -std=gnu99 -Wstrict-prototypes -DF_CPU=16000000UL -DUSE_LUFA_CONFIG_HEADER -IConfig/ -I. -I../LUFA/LUFA/.. -DARCH=ARCH_AVR8 -DBOARD=BOARD_NONE -DF_USB=16000000UL -MMD -MP -MF obj/image.d image.c -o obj/image.o
[LNK] : Linking object files into "Joystick.elf" avr-gcc obj/Joystick.o obj/Descriptors.o obj/image.o obj/HIDParser.o obj/Device_AVR8.o obj/EndpointStream_AVR8.o obj/Endpoint_AVR8.o obj/Host_AVR8.o obj/PipeStream_AVR8.o obj/Pipe_AVR8.o obj/USBController_AVR8.o obj/USBInterrupt_AVR8.o obj/ConfigDescriptors.o obj/DeviceStandardReq.o obj/Events.o obj/HostStandardReq.o obj/USBTask.o -o Joystick.elf -lm -Wl,-Map=Joystick.map,--cref -Wl,--gc-sections -Wl,--relax -mmcu=at90usb1286
[OBJCPY] : Extracting HEX file data from "Joystick.elf" avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature Joystick.elf Joystick.hex
[OBJCPY] : Extracting EEP file data from "Joystick.elf" avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings Joystick.elf Joystick.eep || exit 0
0 [main] sh 7388 sync_with_child: child 7184(0x1D0) died before initialization with status code 0xC0000142
198 [main] sh 7388 sync_with_child: * child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
make: * [Joystick.eep] Error 128
You're supposed go get error 128. It means the hex file was made. Proceed to the next step.
 

Wrn2x

New Member
Newbie
Joined
Sep 18, 2022
Messages
2
Trophies
0
Age
27
Location
Sunnyvale, CA
XP
29
Country
United States
Hi everyone, I followed this post and got it working on Splatoon 3. Thanks for the great tutorial and the contributions in the thread to bring it to Splatoon 3!

However I got an issue trying to print images on my own Switch. As you can see in the attached screenshot, there are two places where two rows of pixels are misaligned by a few. This happens when the cursor suddenly stops moving for a split second, and resumes to print with all pixels in the pause skipped. It almost feels like the switch hangs for a few seconds while dropping all inputs from the emulated controller. On the next row this recovers since the last few pixels in the previous row gets capped at the left/right edge of the canvas.

I tried the printer with different images and different boards (Arduino Micro & Arduino Uno R3), and it happens every time at the same positions (at least very close). I wonder if this is caused by Switch or Splatoon going to sleep and recover after a fixed amount of time. I also tested it on Splatoon 2 and there is no problem at all. Has anyone else had this issue?
 

Attachments

  • IMG_5235.PNG
    IMG_5235.PNG
    950.4 KB · Views: 62
  • Like
Reactions: SaberSam

Aheago

Well-Known Member
Member
Joined
Jan 4, 2021
Messages
505
Trophies
0
Age
33
XP
1,222
Country
United States
Hi everyone, I followed this post and got it working on Splatoon 3. Thanks for the great tutorial and the contributions in the thread to bring it to Splatoon 3!

However I got an issue trying to print images on my own Switch. As you can see in the attached screenshot, there are two places where two rows of pixels are misaligned by a few. This happens when the cursor suddenly stops moving for a split second, and resumes to print with all pixels in the pause skipped. It almost feels like the switch hangs for a few seconds while dropping all inputs from the emulated controller. On the next row this recovers since the last few pixels in the previous row gets capped at the left/right edge of the canvas.

I tried the printer with different images and different boards (Arduino Micro & Arduino Uno R3), and it happens every time at the same positions (at least very close). I wonder if this is caused by Switch or Splatoon going to sleep and recover after a fixed amount of time. I also tested it on Splatoon 2 and there is no problem at all. Has anyone else had this issue?
Have you tried doing it via handheld mode by chance? With a usb c adapter

The switch is very particular with what usb port it uses through the doc with these micro controllers I’ve noticed. No idea why but even my Twitch bot one needed to use the bottom usb on the dock. The top would cause random disconnects
 
  • Like
Reactions: Wrn2x

mrwang

Member
Newcomer
Joined
Mar 23, 2020
Messages
7
Trophies
0
Age
24
XP
127
Country
Taiwan
Getting error message when running "make uno"

>make uno
0 [main] sh 6324 sync_with_child: child 10872(0x1E8) died before initialization with status code 0xC0000142
145 [main] sh 6324 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
0 [main] sh 5612 sync_with_child: child 16276(0x1F4) died before initialization with status code 0xC0000142
254 [main] sh 5612 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
0 [main] sh 6960 sync_with_child: child 17340(0x184) died before initialization with status code 0xC0000142
230 [main] sh 6960 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
makefile:50: warning: overriding commands for target `teensy'
../LUFA/LUFA/Build/DMBS/DMBS/hid.mk:43: warning: ignoring old commands for target `teensy'
MCU=atmega16u2 make all
make: *** [uno] Error -1073741502
 

Aheago

Well-Known Member
Member
Joined
Jan 4, 2021
Messages
505
Trophies
0
Age
33
XP
1,222
Country
United States
Getting error message when running "make uno"

>make uno
0 [main] sh 6324 sync_with_child: child 10872(0x1E8) died before initialization with status code 0xC0000142
145 [main] sh 6324 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
0 [main] sh 5612 sync_with_child: child 16276(0x1F4) died before initialization with status code 0xC0000142
254 [main] sh 5612 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
0 [main] sh 6960 sync_with_child: child 17340(0x184) died before initialization with status code 0xC0000142
230 [main] sh 6960 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
makefile:50: warning: overriding commands for target `teensy'
../LUFA/LUFA/Build/DMBS/DMBS/hid.mk:43: warning: ignoring old commands for target `teensy'
MCU=atmega16u2 make all
make: *** [uno] Error -1073741502
Try following this guide and lmk if you get the same error https://www.se7ensins.com/forums/th...x-on-windows-for-the-nintendo-switch.1788481/

I was having a very similar issue as Wrn2x
Same question for you, I may be able to help

Have you tried doing it via handheld mode by chance? With a usb c adapter

The switch is very particular with what usb port it uses through the doc with these micro controllers I’ve noticed. No idea why but even my Twitch bot one needed to use the bottom usb on the dock. The top would cause random disconnects
 

Wrn2x

New Member
Newbie
Joined
Sep 18, 2022
Messages
2
Trophies
0
Age
27
Location
Sunnyvale, CA
XP
29
Country
United States
Have you tried doing it via handheld mode by chance? With a usb c adapter

The switch is very particular with what usb port it uses through the doc with these micro controllers I’ve noticed. No idea why but even my Twitch bot one needed to use the bottom usb on the dock. The top would cause random disconnects
Thanks for checking! I forgot to mention that all my attempts were done in handheld mode with a USB-C to USB-B/micro-USB cable. I tried again in dock mode with the middle USB-A port and the attached screenshot is what I got. It looks like the issue happens in either mode.

Also I'm not sure I know the top/bottom USB port on the dock as you mentioned. There are only 3 ports on my dock (from top to down): a USB-C port to AC adapter, a USB-A port (I used this), and an HDMI port. When I disconnect the top port to power my Switch goes to sleep automatically.
 

Attachments

  • dock.PNG
    dock.PNG
    1.1 MB · Views: 54

ktpttl

New Member
Newbie
Joined
Sep 21, 2022
Messages
1
Trophies
0
Age
26
Location
e
XP
15
Country
Poland
when I type in "make" command i recieve back
"/bin/sh: avr-size: command not found
/bin/sh: avr-size: command not found
[INFO] : Begin compilation of project "Joystick"...

make: avr-gcc: No such file or directory
make: *** [C:\Switch-Fightstick\LUFA\LUFA/Build/DMBS/DMBS/gcc.mk:156: build_begin] Error 127"
how to fix this?
 

Attachments

  • Zrzut ekranu 2022-09-21 042604.png
    Zrzut ekranu 2022-09-21 042604.png
    30.6 KB · Views: 60

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: https://stockanalysis.com/stocks/ntdoy/market-cap/ I think they'll be alright