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

Which AVR are you using?


  • Total voters
    55

SpiceDisUp

Active Member
Newcomer
Joined
Dec 5, 2017
Messages
30
Trophies
0
XP
105
Country
United States
Im having the same problem as @GomiHiko. i did what they did to fix it but it didnt fix it for me. I still get
'make' is not recognized as an internal or external command,
operable program or batch file.
 

zxr750j

Longtime member
Member
Joined
Sep 29, 2003
Messages
936
Trophies
2
Location
Utrecht
XP
2,934
Country
Netherlands
Had to do the same with my Teensy since it's inside a SNES controller

Did you wire the buttons from this controller and rewrote the code to use them or just use the "default" joystick.c?
I just ordered a teensy and plan to use it for pokemon automation, it would be nice to use controller buttons to move ingame and trigger sequences...
 
D

Deleted User

Guest
Did you wire the buttons from this controller and rewrote the code to use them or just use the "default" joystick.c?
I just ordered a teensy and plan to use it for pokemon automation, it would be nice to use controller buttons to move ingame and trigger sequences...
If that is all you want to do, I recommend taking a look at my CommunityController repo as you can do pretty much anything you'd like via python

The only downside is that it requires an Arduino uno opposed to a Teensy since I lost the original source
 

zxr750j

Longtime member
Member
Joined
Sep 29, 2003
Messages
936
Trophies
2
Location
Utrecht
XP
2,934
Country
Netherlands
If that is all you want to do, I recommend taking a look at my CommunityController repo as you can do pretty much anything you'd like via python

The only downside is that it requires an Arduino uno opposed to a Teensy since I lost the original source

I will look at it!! I'm really not a hardcore C programmer, but even I can make a Python-script. I allready made a contraption using a 3ds controlled with a Raspberry and a 8port relay, it worked and made very nice analogue clicking sounds :)

Thanks for your reply!
 

Proto-Propski

Legally Weird!
Member
Joined
Apr 29, 2018
Messages
266
Trophies
0
Age
25
Location
Boulevard of Broken Meme's
XP
768
Country
United Kingdom
I'm still getting this error when trying to compile the Joystick.hex I got WinAVR, MinGW, Python27, and the AVR8 Toolchain setup in my PATH, running it in administrator even, but I can't get any further.


Code:
C:\Switch Dev\Splatmeme-Printer>mingw32-make
      0 [main] sh 6452 sync_with_child: child 13396(0x1E4) died before initialization with status code 0xC0000142
    263 [main] sh 6452 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
      0 [main] sh 3292 sync_with_child: child 1308(0x1F0) died before initialization with status code 0xC0000142
    303 [main] sh 3292 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
      0 [main] sh 5072 sync_with_child: child 5504(0x1F0) died before initialization with status code 0xC0000142
    267 [main] sh 5072 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. -I./LUFA/LUFA/.. -DARCH=ARCH_AVR8 -DBOARD=BOARD_NONE -DF_USB=16000000UL  -MMD -MP -MF obj/Joystick.d Joystick.c -o obj/Joystick.o
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.)
LUFA/LUFA/Build/DMBS/DMBS/gcc.mk:213: recipe for target 'obj/Joystick.o' failed
mingw32-make: *** [obj/Joystick.o] Error 1

C:\Switch Dev\Splatmeme-Printer>
 

SnazzyMcSpiff

New Member
Newbie
Joined
Apr 7, 2020
Messages
1
Trophies
0
Age
28
XP
34
Country
United States
I've had two errors that I had to fix.
1. For the error:
Code:
Joystick.c:213: error: 'clock_div_1' undeclared (first use in this function)
I replaced Joystick.c line 212
Code:
clock_prescale_set(clock_div_1);
with
Code:
CLKPR = (1 << CLKPCE); CLKPR = (0 << CLKPS3) | (0 << CLKPS2) | (0 << CLKPS1) | (0 << CLKPS0);
2. @Proto-Propski I had this error. I think the makefile tries to put intermediate files in a folder called "obj", but there is no obj folder. I simply made a folder called "obj" for it to put the files in and it worked!
 

zxr750j

Longtime member
Member
Joined
Sep 29, 2003
Messages
936
Trophies
2
Location
Utrecht
XP
2,934
Country
Netherlands
I've had two errors that I had to fix.
1. For the error:
Code:
Joystick.c:213: error: 'clock_div_1' undeclared (first use in this function)
I replaced Joystick.c line 212
Code:
clock_prescale_set(clock_div_1);
with
Code:
CLKPR = (1 << CLKPCE); CLKPR = (0 << CLKPS3) | (0 << CLKPS2) | (0 << CLKPS1) | (0 << CLKPS0);
2. @Proto-Propski I had this error. I think the makefile tries to put intermediate files in a folder called "obj", but there is no obj folder. I simply made a folder called "obj" for it to put the files in and it worked!

How did you know how to fix this...

Anyway: Thanks!!
 

Jawbreaker

Member
Newcomer
Joined
Nov 21, 2012
Messages
6
Trophies
0
Age
30
XP
67
Country
United States
I've had two errors that I had to fix.
1. For the error:
Code:
Joystick.c:213: error: 'clock_div_1' undeclared (first use in this function)
I replaced Joystick.c line 212
Code:
clock_prescale_set(clock_div_1);
with
Code:
CLKPR = (1 << CLKPCE); CLKPR = (0 << CLKPS3) | (0 << CLKPS2) | (0 << CLKPS1) | (0 << CLKPS0);
2. @Proto-Propski I had this error. I think the makefile tries to put intermediate files in a folder called "obj", but there is no obj folder. I simply made a folder called "obj" for it to put the files in and it worked!
Now I'm getting this error. :(
C:\Users\Chico\Desktop\Splatmeme-Printer-master>make
0 [main] sh 9828 sync_with_child: child 11892(0x1EC) died before initialization with status code 0xC0000142
186 [main] sh 9828 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
0 [main] sh 4536 sync_with_child: child 12080(0x1EC) died before initialization with status code 0xC0000142
228 [main] sh 4536 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. -I./LUFA/.. -DARCH=ARCH_AVR8 -DBOARD=BOARD_NONE -DF_USB=16000000UL -DF_CPU=16000000UL -mrelax -fno-jump-tables -x c -Os -std=gnu99 -Wstrict-prototypes -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DZIG_ZAG_PRINTING -MMD -MP -MF Joystick.d Joystick.c -o Joystick.o
In file included from Joystick.h:53,
from Joystick.c:27:
Descriptors.h:52: error: conflicting types for 'CALLBACK_USB_GetDescriptor'
./LUFA/Drivers/USB/Core/AVR8/../Device.h:133: error: previous declaration of 'CALLBACK_USB_GetDescriptor' was here
make: *** [Joystick.o] Error 1
 

ezkitty

Well-Known Member
Member
Joined
Jul 28, 2021
Messages
165
Trophies
0
Age
26
XP
842
Country
United States
Is this working for splatoon 3? I tested it in splatoon 2 and it works fine but not for splatoon 3. It draws just a bunch of random lines and dots on the left side of the drawing. Right side is completely ignored
 

Rayya

Member
Newcomer
Joined
Sep 11, 2022
Messages
8
Trophies
0
Age
29
Location
Yokohama
XP
52
Country
Japan
Is this working for splatoon 3? I tested it in splatoon 2 and it works fine but not for splatoon 3. It draws just a bunch of random lines and dots on the left side of the drawing. Right side is completely ignored
Heya, I got this for the sole purpose of using it in Splatoon 3. After 8+ hours of trial an error, I can confirm it works! What you'll have to do to get it to work however, is follow everything in the linked github. BUT, before you use the "make" command, open Joystick.c in notepad and find the line that talks about:

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

And remove it completely. In splatoon 2, the minus button is used to clear the screen, but in Splatoon 3, they moved that button to L Stick button. Because of this, the Minus button in splatoon 3 will "save and close" the post.
 
  • Like
Reactions: Kamille

Rayya

Member
Newcomer
Joined
Sep 11, 2022
Messages
8
Trophies
0
Age
29
Location
Yokohama
XP
52
Country
Japan
Is this working for splatoon 3? I tested it in splatoon 2 and it works fine but not for splatoon 3. It draws just a bunch of random lines and dots on the left side of the drawing. Right side is completely ignored
Is this working for splatoon 3? I tested it in splatoon 2 and it works fine but not for splatoon 3. It draws just a bunch of random lines and dots on the left side of the drawing. Right side is completely ignored
Heya, I got this for the sole purpose of using it in Splatoon 3. After 8+ hours of trial an error, I can confirm it works! What you'll have to do to get it to work however, is follow everything in the linked github. BUT, before you use the "make" command, open Joystick.c in notepad and find the line that talks about:

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

And remove it completely. In splatoon 2, the minus button is used to clear the screen, but in Splatoon 3, they moved that button to L Stick button. Because of this, the Minus button in splatoon 3 will "save and close" the post.
 

ScorpioGNT

New Member
Newbie
Joined
Sep 11, 2022
Messages
2
Trophies
0
Age
23
Location
A place
XP
28
Country
Canada
Heya, I got this for the sole purpose of using it in Splatoon 3. After 8+ hours of trial an error, I can confirm it works! What you'll have to do to get it to work however, is follow everything in the linked github. BUT, before you use the "make" command, open Joystick.c in notepad and find the line that talks about:

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

And remove it completely. In splatoon 2, the minus button is used to clear the screen, but in Splatoon 3, they moved that button to L Stick button. Because of this, the Minus button in splatoon 3 will "save and close" the post.
You can also replace "SWITCH_MINUS" with "SWITCH_LCLICK". My only problem now is that the cursor is wiggling and rubbing up alongside the sides of the canvas.

This is what happens to me
Screenshot 2022-09-11 125309.png
 
  • Like
Reactions: Kamille and Rayya

Kamille

Member
Newcomer
Joined
Jul 25, 2008
Messages
15
Trophies
1
Location
Seireitei
XP
208
Country
United States
Hi everyone, I have and Arduino Leonardo (atmega32u4) and after about putting in close to an hour of work I am stuck on Step 5 with a when it comes to flashing the Joystick.hex to my Ardunio. Both the tutorial and github talk about avrdude giving you a code when you upload any sketch to it. My question is where exactly is this code located? there's a bunch of lines that start with avrdude but I dont see anything that would be a command line code.

Second, when it comes to uploading a sketch to the ardunio in step 4, does it matter if it's a blank sketch? Is that a possible reason why when I go into step 5 I am getting no code back for avrdude? I'm extremely new to the arduino scene and don't know what type or kind of sketch I'm needing to upload, or if the blank code is good enough.

Thank you to anyone who can help.







Edit: After tinkering away for some hours with this yesterday. I managed to figure out some helpful information for those who are using an Arduino Leonardo. I'm a Windows 10 user, so the steps I outline will be different for everyone else.

When it comes to uploading a .hex file to your Arduino Leonardo, you can use https://github.com/twinearthsoftware/ArduinoSketchUploader to upload your Joystick.hex file to your Ardunio. If by chance you want to upload a new sketch, you can do the following. It will require the Arduino IDE software to be installed.

  1. First plugin your Ardunio to your PC
  2. Start up the Arduino IDE software, doesn't matter what sketch you have open. For this, I use a blank sketch file.
  3. Hit the "Upload" button on the Arduino IDE software. It should take a little bit of time to compile a blank sketch then attempt to upload to your Ardunio Leonardo. It will constantly look for which COM and Port your Arduino is on.
  4. Press the "reset" button that is on your Arduino Leonardo while your sketch from Arduino IDE is attempting to upload.
  5. If everything goes right, the Arduino should allow the com port to be open and you should see that your sketch file has successfully uploaded to your Ardunio, now use the ArdunioSketchUploaded to upload another Joystick.hex file as needed.
 
Last edited by Kamille,

Kamille

Member
Newcomer
Joined
Jul 25, 2008
Messages
15
Trophies
1
Location
Seireitei
XP
208
Country
United States
You can also replace "SWITCH_MINUS" with "SWITCH_LCLICK". My only problem now is that the cursor is wiggling and rubbing up alongside the sides of the canvas.

This is what happens to me
View attachment 326761
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.
 
Last edited by Kamille,

SaberSam

New Member
Newbie
Joined
Sep 14, 2022
Messages
3
Trophies
0
Age
25
Location
California
XP
23
Country
United States
Hi everyone, I have and Arduino Leonardo (atmega32u4) and after about putting in close to an hour of work I am stuck on Step 5 with a when it comes to flashing the Joystick.hex to my Ardunio. Both the tutorial and github talk about avrdude giving you a code when you upload any sketch to it. My question is where exactly is this code located? there's a bunch of lines that start with avrdude but I dont see anything that would be a command line code.

Second, when it comes to uploading a sketch to the ardunio in step 4, does it matter if it's a blank sketch? Is that a possible reason why when I go into step 5 I am getting no code back for avrdude? I'm extremely new to the arduino scene and don't know what type or kind of sketch I'm needing to upload, or if the blank code is good enough.

Thank you to anyone who can help.
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.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    The Real Jdbye @ The Real Jdbye: no, cod sucks +2