Not a developer, but

i know it will sound stupid but i recently purchased this:

and its firmware is bases arduino.... now I'm trying to upload this sketch right here to make this thing work

'Joystick_' does not name a type; did you mean 'Joystick'?

is the code itself the problem?
am i doing something wrong?
i know it's dumb
here's the code:

thanks!

Please post the full error message using code tags when you do. The easiest way to copy the error message is to use the "Copy error message" button in the IDE

At a guess the code is trying to use an object named Joystick_ when it is actually named Joystick

From where did you get this library: #include <Joystick.h> ?
From your code, it should contain a type Joystick_ and this appears to be missing.

here you go
Arduino: 1.8.15 (Windows 10), Board: "Arduino Leonardo"

vsFIGHTER2gamepad:20:1: error: 'Joystick_' does not name a type; did you mean 'Joystick'?

Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID,JOYSTICK_TYPE_GAMEPAD,

^~~~~~~~~

Joystick

C:\Users\omrih\Desktop\vsFIGHTER-main\software\vsFIGHTER2gamepad\vsFIGHTER2gamepad.ino: In function 'void setup()':

vsFIGHTER2gamepad:47:11: error: expected unqualified-id before '.' token

Joystick.begin();

       ^

vsFIGHTER2gamepad:48:11: error: expected unqualified-id before '.' token

Joystick.setXAxisRange(-1, 1);

       ^

vsFIGHTER2gamepad:49:11: error: expected unqualified-id before '.' token

Joystick.setYAxisRange(-1, 1);

       ^

C:\Users\omrih\Desktop\vsFIGHTER-main\software\vsFIGHTER2gamepad\vsFIGHTER2gamepad.ino: In function 'void loop()':

vsFIGHTER2gamepad:62:13: error: expected unqualified-id before '.' token

 Joystick.setYAxis(-1);

         ^

vsFIGHTER2gamepad:65:13: error: expected unqualified-id before '.' token

 Joystick.setYAxis(1);

         ^

vsFIGHTER2gamepad:68:13: error: expected unqualified-id before '.' token

 Joystick.setYAxis(0);

         ^

vsFIGHTER2gamepad:71:13: error: expected unqualified-id before '.' token

 Joystick.setXAxis(-1);

         ^

vsFIGHTER2gamepad:74:13: error: expected unqualified-id before '.' token

 Joystick.setXAxis(1);

         ^

vsFIGHTER2gamepad:77:13: error: expected unqualified-id before '.' token

 Joystick.setXAxis(0);

         ^

vsFIGHTER2gamepad:137:21: error: expected unqualified-id before '.' token

         Joystick.setYAxis(-1);

                 ^

vsFIGHTER2gamepad:139:21: error: expected unqualified-id before '.' token

         Joystick.setYAxis(0);

                 ^

vsFIGHTER2gamepad:144:21: error: expected unqualified-id before '.' token

         Joystick.setXAxis(1);

                 ^

vsFIGHTER2gamepad:146:21: error: expected unqualified-id before '.' token

         Joystick.setXAxis(0);

                 ^

vsFIGHTER2gamepad:151:21: error: expected unqualified-id before '.' token

         Joystick.setYAxis(1);

                 ^

vsFIGHTER2gamepad:153:21: error: expected unqualified-id before '.' token

         Joystick.setYAxis(0);

                 ^

vsFIGHTER2gamepad:158:21: error: expected unqualified-id before '.' token

         Joystick.setXAxis(-1);

                 ^

vsFIGHTER2gamepad:160:21: error: expected unqualified-id before '.' token

         Joystick.setXAxis(0);

                 ^

vsFIGHTER2gamepad:164:19: error: expected unqualified-id before '.' token

       Joystick.setButton(0, currentButtonState);

               ^

vsFIGHTER2gamepad:167:19: error: expected unqualified-id before '.' token

       Joystick.setButton(1, currentButtonState);

               ^

vsFIGHTER2gamepad:170:19: error: expected unqualified-id before '.' token

       Joystick.setButton(2, currentButtonState);

               ^

vsFIGHTER2gamepad:173:19: error: expected unqualified-id before '.' token

       Joystick.setButton(3, currentButtonState);

               ^

vsFIGHTER2gamepad:176:19: error: expected unqualified-id before '.' token

       Joystick.setButton(4, currentButtonState);

               ^

vsFIGHTER2gamepad:179:19: error: expected unqualified-id before '.' token

       Joystick.setButton(5, currentButtonState);

               ^

vsFIGHTER2gamepad:182:19: error: expected unqualified-id before '.' token

       Joystick.setButton(6, currentButtonState);

               ^

vsFIGHTER2gamepad:185:19: error: expected unqualified-id before '.' token

       Joystick.setButton(7, currentButtonState);

               ^

vsFIGHTER2gamepad:188:19: error: expected unqualified-id before '.' token

       Joystick.setButton(8, currentButtonState);

               ^

vsFIGHTER2gamepad:191:19: error: expected unqualified-id before '.' token

       Joystick.setButton(9, currentButtonState);

               ^

vsFIGHTER2gamepad:194:19: error: expected unqualified-id before '.' token

       Joystick.setButton(10, currentButtonState);

               ^

vsFIGHTER2gamepad:197:19: error: expected unqualified-id before '.' token

       Joystick.setButton(11, currentButtonState);

               ^

exit status 1

'Joystick_' does not name a type; did you mean 'Joystick'?

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

@omri300, your topic has been moved to a more suitable location on the forum.

The "Joystick" library from Library Manager is NOT the right one. You need GitHub - MHeironimus/ArduinoJoystickLibrary: An Arduino library that adds one or more joysticks to the list of HID devices an Arduino Leonardo or Arduino Micro can support.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.